Skip to content

Commit

Permalink
[ENH] Add routing, add binding
Browse files Browse the repository at this point in the history
  • Loading branch information
dragarthPl committed May 8, 2024
1 parent 3c92de0 commit 7179bca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/core/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from main.temperature.water_heater_temperature_repository import IWaterHeaterTemperatureRepository, \
WaterHeaterTemperatureRepository
from main.flame_size.flame_size_repository import IFlameSizeRepository, FlameSizeRepository
from main.summer_mode.summer_mode_repository import ISummerModeRepository, SummerModeRepository


def container(binder: Binder) -> None:
Expand All @@ -17,6 +18,7 @@ def container(binder: Binder) -> None:
binder.bind(IHeatingTemperatureRepository, to=HeatingTemperatureRepository) # type: ignore[type-abstract]
binder.bind(IStoveStateRepository, to=StoveStateRepository) # type: ignore[type-abstract]
binder.bind(IFlameSizeRepository, to=FlameSizeRepository) # type: ignore[type-abstract]
binder.bind(ISummerModeRepository, to=SummerModeRepository) # type: ignore[type-abstract]
binder.bind(
Redis,
to=Redis(host=configuration.redis_ip, port=configuration.redis_port, decode_responses=True)
Expand Down
2 changes: 2 additions & 0 deletions src/main/home_periscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from main.stove_state.stove_state_controller import stove_state_router
from main.temperature.temperature_controller import temperature_router
from main.flame_size.flame_size_controller import flame_size_router
from main.summer_mode.summer_mode_controller import summer_mode_router
from stove_connector.stream_stove_data import StreamStoveData

configuration = Configuration()
Expand All @@ -34,6 +35,7 @@ def __init__(self, configure: Callable[[Binder], None]):
self.application.include_router(temperature_router)
self.application.include_router(stove_state_router)
self.application.include_router(flame_size_router)
self.application.include_router(summer_mode_router)
self.application.state.injector = a_injector
attach_injector(self.application, a_injector)
if not configuration.features.demo_mode:
Expand Down
1 change: 0 additions & 1 deletion src/main/temperature/temperature_controller.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from fastapi import Request

from attrs import asdict
from fastapi.openapi.models import Response
from fastapi_injector import Injected
from fastapi_utils.cbv import cbv
from fastapi_utils.inferring_router import InferringRouter
Expand Down

0 comments on commit 7179bca

Please sign in to comment.