From 84ffac33f58c8bba9690ab058d1c8faa3fb2ffa3 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sun, 6 Nov 2022 21:33:32 +0300 Subject: inverter_bot: fix generation command --- src/inverter_bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inverter_bot.py b/src/inverter_bot.py index cd081b4..1ac702c 100755 --- a/src/inverter_bot.py +++ b/src/inverter_bot.py @@ -802,7 +802,7 @@ def generation_handler(ctx: bot.Context) -> None: gs = inverter.exec('get-status')['data'] - today = inverter.exec('get-day-generated', (today.year, today.month, today.day))['data'] + gen_today = inverter.exec('get-day-generated', (today.year, today.month, today.day))['data'] gen_yday = None gen_yday2 = None @@ -816,7 +816,7 @@ def generation_handler(ctx: bot.Context) -> None: html = f'{ctx.lang("gen_input_power")}: %s %s' % (gs['pv1_input_power']['value'], gs['pv1_input_power']['unit']) html += ' (%s %s)' % (gs['pv1_input_voltage']['value'], gs['pv1_input_voltage']['unit']) - html += f'\n{ctx.lang("today")}: %s Wh' % (today['wh']) + html += f'\n{ctx.lang("today")}: %s Wh' % (gen_today['wh']) if gen_yday is not None: html += f'\n{ctx.lang("yday1")}: %s Wh' % (gen_yday['wh']) -- cgit v1.2.3