summaryrefslogtreecommitdiff
path: root/include/py/homekit
diff options
context:
space:
mode:
Diffstat (limited to 'include/py/homekit')
-rw-r--r--include/py/homekit/inverter/monitor.py2
-rw-r--r--include/py/homekit/telegram/bot.py20
2 files changed, 11 insertions, 11 deletions
diff --git a/include/py/homekit/inverter/monitor.py b/include/py/homekit/inverter/monitor.py
index 86f75ac..5955d92 100644
--- a/include/py/homekit/inverter/monitor.py
+++ b/include/py/homekit/inverter/monitor.py
@@ -25,7 +25,7 @@ def _pd_from_string(pd: str) -> BatteryPowerDirection:
class MonitorConfig:
def __getattr__(self, item):
- return config['monitor'][item]
+ return config.app_config['monitor'][item]
cfg = MonitorConfig()
diff --git a/include/py/homekit/telegram/bot.py b/include/py/homekit/telegram/bot.py
index 8a78c6f..2efd9e4 100644
--- a/include/py/homekit/telegram/bot.py
+++ b/include/py/homekit/telegram/bot.py
@@ -274,7 +274,7 @@ class conversation:
continue
cd = f.__dict__['_conv_data']
if cd['enter'] and cd['state'] == state:
- return cd['orig_f'](self, ctx)
+ return await cd['orig_f'](self, ctx)
raise RuntimeError(f'invoke: failed to find method for state {state}')
@@ -362,14 +362,14 @@ class conversation:
# buttons.insert(0, [ctx.lang('back')])
buttons.append([ctx.lang('back')])
- def reply(self,
- ctx: Context,
- state: Union[int, Enum],
- text: str,
- buttons: Optional[list],
- with_cancel=False,
- with_back=False,
- buttons_lang_completed=False):
+ async def reply(self,
+ ctx: Context,
+ state: Union[int, Enum],
+ text: str,
+ buttons: Optional[list],
+ with_cancel=False,
+ with_back=False,
+ buttons_lang_completed=False):
if buttons:
new_buttons = []
@@ -400,7 +400,7 @@ class conversation:
self.add_back_button(ctx, new_buttons)
markup = ReplyKeyboardMarkup(new_buttons, one_time_keyboard=True) if new_buttons else IgnoreMarkup()
- ctx.reply(text, markup=markup)
+ await ctx.reply(text, markup=markup)
self.set_user_state(ctx.user_id, state)
return state