zacs / ha-dualmodegeneric

Generic thermostat capable of heating and cooling
68 stars 26 forks source link

keep_alive not working #31

Closed leshric closed 2 years ago

leshric commented 3 years ago

I'm getting this in the log:

Logger: homeassistant Source: custom_components/dualmode_generic/climate.py:814 Integration: dualmode_generic (documentation) First occurred: 10:42:40 AM (1 occurrences) Last logged: 10:42:40 AM Error doing job: Task exception was never retrieved

Traceback (most recent call last): File "/config/custom_components/dualmode_generic/climate.py", line 814, in _async_control_heating "Keep-alive - Turning off %s", active_entity UnboundLocalError: local variable 'active_entity' referenced before assignment

active_entity is never set during a call for keep_alive.

david-kalbermatten commented 3 years ago

Yes, I'm sorry. This one is me. I forgot to check whether or not active_entity was assigned when used here:

_LOGGER.info(
    "Keep-alive - Turning off %s", active_entity
)

I moved the assignment further outside in the corresponding function in my PR #32.

david-kalbermatten commented 3 years ago

@leshric or @zacs If my PR #32 fixed this issue please feel free to close it ;D

zacs commented 2 years ago

Fixed in #32