current temp could be none (#6759)

This commit is contained in:
John Arild Berentsen authored and Paulus Schoutsen committed 2017-03-23 23:50:36 -07:00
1 parent 0b7f873120
commit 82c599a749
1 file changed
+3 -2
+3 -2
View File
@@ -112,8 +112,9 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
_LOGGER.debug("Setpoint is 0, setting default to "
"current_temperature=%s",
self._current_temperature)
self._target_temperature = (
round((float(self._current_temperature)), 1))
if self._current_temperature is not None:
self._target_temperature = (
round((float(self._current_temperature)), 1))
else:
self._target_temperature = round(
(float(self.values.primary.data)), 1)