Sensor device classes (#14282)

* Added light device class, moved device classes to const

* Removed unnecessary icons

* Replace 'lux' with 'lx'

* Fix comment

* Changed device_class name
This commit is contained in:
cdce8p authored and Paulus Schoutsen committed 2018-05-05 09:37:40 -04:00
1 parent ec3ce4c80d
commit 95d27bd1fa
19 files changed
+92 -79

No files matched your search

+3 -2
View File
@@ -5,7 +5,8 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.ecobee/
"""
from homeassistant.components import ecobee
from homeassistant.const import TEMP_FAHRENHEIT
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, TEMP_FAHRENHEIT)
from homeassistant.helpers.entity import Entity
DEPENDENCIES = ['ecobee']
@@ -55,7 +56,7 @@ class EcobeeSensor(Entity):
@property
def device_class(self):
"""Return the device class of the sensor."""
if self.type in ('temperature', 'humidity'):
if self.type in (DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE):
return self.type
return None