Return a 0 temperature value when none is found (#8518)

* Return a 0 temperature value when none is found

It's well documented that these TRVs will only return the current temperature
for a short time after the actuator has moved. This means that, usually, they will
not return the current temperature. Setting a non-value here causes errors in the logs
and for the TRV to not show on the dashboard at all

* Fix lint issue
This commit is contained in:
Phil Lavin 2017-07-17 22:34:38 +01:00 committed by Fabian Affolter
parent fde4a7d029
commit dcd6f7a29e

View File

@ -10,7 +10,6 @@ import logging
from homeassistant.components.climate import ClimateDevice, STATE_AUTO
from homeassistant.components.maxcube import MAXCUBE_HANDLE
from homeassistant.const import TEMP_CELSIUS, ATTR_TEMPERATURE
from homeassistant.const import STATE_UNKNOWN
_LOGGER = logging.getLogger(__name__)
@ -140,7 +139,7 @@ class MaxCubeClimate(ClimateDevice):
def map_temperature_max_hass(temperature):
"""Map Temperature from MAX! to HASS."""
if temperature is None:
return STATE_UNKNOWN
return 0.0
return temperature