diff --git a/homeassistant/components/sensor/velbus.py b/homeassistant/components/sensor/velbus.py index ea4af320add..8e9aafd3605 100644 --- a/homeassistant/components/sensor/velbus.py +++ b/homeassistant/components/sensor/velbus.py @@ -6,8 +6,6 @@ https://home-assistant.io/components/sensor.velbus/ """ import logging -from homeassistant.const import ( - TEMP_CELSIUS, DEVICE_CLASS_TEMPERATURE) from homeassistant.components.velbus import ( DOMAIN as VELBUS_DOMAIN, VelbusEntity) @@ -25,24 +23,24 @@ async def async_setup_platform(hass, config, async_add_entities, for sensor in discovery_info: module = hass.data[VELBUS_DOMAIN].get_module(sensor[0]) channel = sensor[1] - sensors.append(VelbusTempSensor(module, channel)) + sensors.append(VelbusSensor(module, channel)) async_add_entities(sensors) -class VelbusTempSensor(VelbusEntity): - """Representation of a temperature sensor.""" +class VelbusSensor(VelbusEntity): + """Representation of a sensor.""" @property def device_class(self): """Return the device class of the sensor.""" - return DEVICE_CLASS_TEMPERATURE + return self._module.get_class(self._channel) @property def state(self): """Return the state of the sensor.""" - return self._module.getCurTemp() + return self._module.get_state(self._channel) @property def unit_of_measurement(self): """Return the unit this state is expressed in.""" - return TEMP_CELSIUS + return self._module.get_unit(self._channel) diff --git a/homeassistant/components/velbus.py b/homeassistant/components/velbus.py index d2def6f96bc..2304054c404 100644 --- a/homeassistant/components/velbus.py +++ b/homeassistant/components/velbus.py @@ -12,7 +12,7 @@ from homeassistant.const import EVENT_HOMEASSISTANT_STOP, CONF_PORT from homeassistant.helpers.discovery import load_platform from homeassistant.helpers.entity import Entity -REQUIREMENTS = ['python-velbus==2.0.19'] +REQUIREMENTS = ['python-velbus==2.0.20'] _LOGGER = logging.getLogger(__name__) @@ -48,7 +48,7 @@ async def async_setup(hass, config): discovery_info = { 'switch': [], 'binary_sensor': [], - 'temp_sensor': [] + 'sensor': [] } for module in modules: for channel in range(1, module.number_of_channels() + 1): @@ -63,7 +63,7 @@ async def async_setup(hass, config): load_platform(hass, 'binary_sensor', DOMAIN, discovery_info['binary_sensor'], config) load_platform(hass, 'sensor', DOMAIN, - discovery_info['temp_sensor'], config) + discovery_info['sensor'], config) controller.scan(callback) diff --git a/requirements_all.txt b/requirements_all.txt index 9f3fa57ddba..ca00fad60c6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1161,7 +1161,7 @@ python-telegram-bot==11.0.0 python-twitch-client==0.6.0 # homeassistant.components.velbus -python-velbus==2.0.19 +python-velbus==2.0.20 # homeassistant.components.media_player.vlc python-vlc==1.1.2