forked from home-assistant/core
unit fix (#3083)
This commit is contained in:
committed by
GitHub
parent
e5b6592870
commit
5f664acb4f
@@ -12,6 +12,7 @@ from homeassistant.components.climate import ClimateDevice
|
|||||||
from homeassistant.components.zwave import (
|
from homeassistant.components.zwave import (
|
||||||
ATTR_NODE_ID, ATTR_VALUE_ID, ZWaveDeviceEntity)
|
ATTR_NODE_ID, ATTR_VALUE_ID, ZWaveDeviceEntity)
|
||||||
from homeassistant.components import zwave
|
from homeassistant.components import zwave
|
||||||
|
from homeassistant.const import (TEMP_CELSIUS, TEMP_FAHRENHEIT)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -186,6 +187,12 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
|
|||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
"""Return the unit of measurement."""
|
"""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
|
@property
|
||||||
|
Reference in New Issue
Block a user