Climate and cover bugfix (#3097)

* Avoid None comparison for zwave cover.

* Just rely on unit from config for unit_of_measurement

* Explicit return None

* Mqtt (#11)

* Explicit return None

* Missing service and wrong service name defined

* Mqtt state was inverted, and never triggering
This commit is contained in:
John Arild Berentsen authored and Teagan Glenn committed 2016-09-01 22:31:25 -06:00
1 parent 9226cef61e
commit a50205aedb
5 files changed
+7 -12

No files matched your search

+1 -9
View File
@@ -12,7 +12,6 @@ from homeassistant.components.climate import ClimateDevice
from homeassistant.components.zwave import (
ATTR_NODE_ID, ATTR_VALUE_ID, ZWaveDeviceEntity)
from homeassistant.components import zwave
from homeassistant.const import (TEMP_CELSIUS, TEMP_FAHRENHEIT)
_LOGGER = logging.getLogger(__name__)
@@ -155,7 +154,6 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
if SET_TEMP_TO_INDEX.get(self._current_operation) \
!= value.index:
continue
self._unit = value.units
if self._zxt_120:
continue
self._target_temperature = int(value.data)
@@ -188,13 +186,7 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
@property
def unit_of_measurement(self):
"""Return the unit of measurement."""
unit = self._unit
if unit == 'C':
return TEMP_CELSIUS
elif unit == 'F':
return TEMP_FAHRENHEIT
else:
return self._unit
return self._unit
@property
def current_temperature(self):