diff --git a/homeassistant/components/lcn/const.py b/homeassistant/components/lcn/const.py index c9ee92fb175..ee7a3a79cde 100644 --- a/homeassistant/components/lcn/const.py +++ b/homeassistant/components/lcn/const.py @@ -1,6 +1,9 @@ +# coding: utf-8 """Constants for the LCN component.""" import re +from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT + DOMAIN = 'lcn' DATA_LCN = 'lcn' DEFAULT_NAME = 'pchk' @@ -49,9 +52,9 @@ THRESHOLDS = ['THRS1', 'THRS2', 'THRS3', 'THRS4', 'THRS5', S0_INPUTS = ['S0INPUT1', 'S0INPUT2', 'S0INPUT3', 'S0INPUT4'] VAR_UNITS = ['', 'LCN', 'NATIVE', - 'CELSIUS', '\u00b0CELSIUS', '\u00b0C', - 'KELVIN', '\u00b0KELVIN', '\u00b0K', - 'FAHRENHEIT', '\u00b0FAHRENHEIT', '\u00b0F' + TEMP_CELSIUS, + '°K', + TEMP_FAHRENHEIT, 'LUX_T', 'LX_T', 'LUX_I', 'LUX', 'LX', 'M/S', 'METERPERSECOND', @@ -59,4 +62,4 @@ VAR_UNITS = ['', 'LCN', 'NATIVE', 'PPM', 'VOLT', 'V', 'AMPERE', 'AMP', 'A', - 'DEGREE', '\u00b0'] + 'DEGREE', '°'] diff --git a/homeassistant/components/lcn/sensor.py b/homeassistant/components/lcn/sensor.py index 6b0a3aa3e4e..e56c42de058 100755 --- a/homeassistant/components/lcn/sensor.py +++ b/homeassistant/components/lcn/sensor.py @@ -43,8 +43,8 @@ class LcnVariableSensor(LcnDevice): super().__init__(config, address_connection) self.variable = self.pypck.lcn_defs.Var[config[CONF_SOURCE]] - self.unit = self.pypck.lcn_defs.VarUnit[ - config[CONF_UNIT_OF_MEASUREMENT]] + self.unit = self.pypck.lcn_defs.VarUnit.parse( + config[CONF_UNIT_OF_MEASUREMENT]) self._value = None