summaryrefslogtreecommitdiff
path: root/src/temphumd.py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-05-31 09:22:00 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-06-10 02:07:23 +0300
commitf29e139cbb7e4a4d539cba6e894ef4a6acd312d6 (patch)
tree6246f126325c5c36fb573134a05f2771cd747966 /src/temphumd.py
parent3e3753d726f8a02d98368f20f77dd9fa739e3d80 (diff)
WIP: big refactoring
Diffstat (limited to 'src/temphumd.py')
-rwxr-xr-xsrc/temphumd.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/temphumd.py b/src/temphumd.py
index f4d1fca..c3d1975 100755
--- a/src/temphumd.py
+++ b/src/temphumd.py
@@ -6,10 +6,11 @@ import logging
from typing import Optional
from home.config import config
-from home.temphum import SensorType, create_sensor, TempHumSensor
+from home.temphum import SensorType, BaseSensor
+from home.temphum.i2c import create_sensor
logger = logging.getLogger(__name__)
-sensor: Optional[TempHumSensor] = None
+sensor: Optional[BaseSensor] = None
lock = asyncio.Lock()
delay = 0.01
@@ -62,7 +63,7 @@ async def run_server(host, port):
if __name__ == '__main__':
- config.load()
+ config.load_app()
if 'measure_delay' in config['sensor']:
delay = float(config['sensor']['measure_delay'])