]> mj.ucw.cz Git - home-hw.git/commitdiff
Telegram: Nits
authorMartin Mares <mj@ucw.cz>
Mon, 14 Feb 2022 18:41:57 +0000 (19:41 +0100)
committerMartin Mares <mj@ucw.cz>
Mon, 14 Feb 2022 18:42:19 +0000 (19:42 +0100)
telegram/TODO [new file with mode: 0644]
telegram/test.py

diff --git a/telegram/TODO b/telegram/TODO
new file mode 100644 (file)
index 0000000..fb057e9
--- /dev/null
@@ -0,0 +1,3 @@
+- ošetření chyb
+- stěžovat si, pokud dlouho nepřijdou teplotní data (asi umřel ARexx)
+- používat teplotu hlášenou kotlem?
index fb940a4f7d5feb473ab2a1a45c75281a3eeba6da..aaff5bfce8a064046a588776bbb1089fc3415361 100755 (executable)
@@ -18,7 +18,7 @@ dp = Dispatcher(bot)
 @dp.message_handler(commands=['start', 'help'])
 async def send_welcome(message: types.Message):
     logging.info(f'Start from {message.chat}')
-    await message.reply("Brum!\nI'm BurrowBot!\n.")
+    await message.reply("Brum!\nI'm BurrowBot!\n")
 
 
 @dp.message_handler()
@@ -78,7 +78,7 @@ def hysteresis(key, value, low, high):
     return new_state
 
 
-last_temp_state = 0
+last_temp_state = 1
 last_boiler_err = 0
 
 
@@ -90,7 +90,7 @@ async def mqtt_process_msg(topic, val):
 
     if topic == 'burrow/temp/catarium':
         temp = float(val.split(' ')[0])
-        temp_state = hysteresis('catarium-temp', temp, 22, 23)
+        temp_state = hysteresis('catarium-temp', temp, 23.2, 23.5)
         if temp_state != last_temp_state:
             last_temp_state = temp_state
             await send_msg(f'Teplota v pracovně: {temp} °C')