Hi,
Maybe is a noob question…
I’m running a callback function for a self.run_at
scheduler
Everything works well except the notification self.notity
I check it outside the callback and it works perfectly.
Could anyone help me, please?
The function is…
def _run_at_cb(self, kwargs):
'''
'''
if 'entity_id' in kwargs and 'action' in kwargs:
entity_id = kwargs['entity_id']
action = kwargs['action']
if action == 'turn_on':
self.log(f"TURN ON {entity_id}")
self.notify(f"TURN ON {entity_id}", name="telegram_nacho", namespace="default")
self.turn_on(entity_id)
elif action == 'turn_off':
self.log(f"TURN OFF {entity_id}")
self.notify(f"TURN OFF {entity_id}", name="telegram_nacho")
self.turn_off(entity_id)
Thanks in advance
EDIT 1:
I don’t understand what the f*** is happening.
If I put a variable in the message, it isn’t sent.
self.notify(f"TURN OFF {entity_id}", name="telegram_nacho")
self.notify("TURN OFF", name="telegram_nacho")
Even if I force the message with str()