From ea57f3df69c37a8023e2a4e4e3cecf78271ba0bb Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 14 Feb 2022 19:41:57 +0100 Subject: [PATCH] Telegram: Nits --- telegram/TODO | 3 +++ telegram/test.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 telegram/TODO diff --git a/telegram/TODO b/telegram/TODO new file mode 100644 index 0000000..fb057e9 --- /dev/null +++ b/telegram/TODO @@ -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? diff --git a/telegram/test.py b/telegram/test.py index fb940a4..aaff5bf 100755 --- a/telegram/test.py +++ b/telegram/test.py @@ -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') -- 2.39.2