pyscript icon indicating copy to clipboard operation
pyscript copied to clipboard

Mqtt-Trigger has problems sometime

Open Beiri22 opened this issue 4 years ago • 0 comments

Hi, I get the following error, sometimes, for one of my mqtt-Trigger:

Logger: custom_components.pyscript
Source: custom_components/pyscript/__init__.py:214
Integration: Pyscript Python scripting (documentation, issues)
First occurred: 14:09:32 (1 occurrences)
Last logged: 14:09:32

task_watchdog: got exception Traceback (most recent call last): File "/config/custom_components/pyscript/mqtt.py", line 79, in notify_del cls.notify_remove[topic]() KeyError: 'indikator/TEMP/chg'

As far as I recognized, the error occurs not on every save.

Source is:

@mqtt_trigger("indikator/TEMP/chg")
@task_unique("manual_temp_change", kill_me=True)
def manual_temp_change(payload):
    manual_actions = {
        "+": input_number.currsoll_temp.increment,
        "-": input_number.currsoll_temp.decrement
    }
    manual_actions[payload]()
    task.sleep(0.125)

Beiri22 avatar Mar 13 '21 13:03 Beiri22