summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/polaris_kettle_bot.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/polaris_kettle_bot.py b/src/polaris_kettle_bot.py
index b0d3fb7..748e8de 100755
--- a/src/polaris_kettle_bot.py
+++ b/src/polaris_kettle_bot.py
@@ -664,14 +664,15 @@ class KettleBot(Wrapper):
current_temp=kc.info.temperature,
mode=kc.info.mode)
message = ctx.reply(html, markup=markup)
- logger.info(f'ctx.reply returned message: {message}')
+ logger.debug(f'ctx.reply returned message: {message}')
- mut = MessageUpdatingTarget(ctx, message,
- initial_power_mode=kc.info.mode,
- user_enabled_power_mode=power_mode,
- user_target_temp=temp)
- mut.set_rendered_content((html, markup))
- kc.add_updating_message(mut)
+ if ok:
+ mut = MessageUpdatingTarget(ctx, message,
+ initial_power_mode=kc.info.mode,
+ user_enabled_power_mode=power_mode,
+ user_target_temp=temp)
+ mut.set_rendered_content((html, markup))
+ kc.add_updating_message(mut)
run_tasks(tasks, done)
@@ -688,13 +689,14 @@ class KettleBot(Wrapper):
else:
html, markup = Renderer.turned_off(ctx, mode=kc.info.mode)
message = ctx.reply(html, markup=markup)
- logger.info(f'ctx.reply returned message: {message}')
-
- mut = MessageUpdatingTarget(ctx, message,
- initial_power_mode=kc.info.mode,
- user_enabled_power_mode=PowerType.OFF)
- mut.set_rendered_content((html, markup))
- kc.add_updating_message(mut)
+ logger.debug(f'ctx.reply returned message: {message}')
+
+ if ok:
+ mut = MessageUpdatingTarget(ctx, message,
+ initial_power_mode=kc.info.mode,
+ user_enabled_power_mode=PowerType.OFF)
+ mut.set_rendered_content((html, markup))
+ kc.add_updating_message(mut)
tasks = queue.SimpleQueue()
tasks.put(['set_power', PowerType.OFF])