Fix TypeError in maxcube climate action inference logic (#133853)

The maxcube-api library initializes the valve_position as a None value,
so that during initialization if the cube does not respond quickly enough
the comparison fails to compare a None-Type to an integer.
This commit is contained in:
Martin Weinelt 2024-12-23 05:26:11 +01:00 committed by GitHub
parent 3658cdba4c
commit cf45c67055
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -171,8 +171,8 @@ class MaxCubeClimate(ClimateEntity):
else:
return None
# Assume heating when valve is open
if valve > 0:
# Assume heating when valve is open.
if valve:
return HVACAction.HEATING
return HVACAction.OFF if self.hvac_mode == HVACMode.OFF else HVACAction.IDLE