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:
1 parent
ec3ce4c80d
commit
95d27bd1fa
19 files changed
+92
-79
No files matched your search
@@ -12,7 +12,7 @@ import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.const import CONF_NAME
|
||||
from homeassistant.const import CONF_NAME, DEVICE_CLASS_ILLUMINANCE
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
REQUIREMENTS = ['i2csense==0.0.4',
|
||||
@@ -130,7 +130,7 @@ class BH1750Sensor(Entity):
|
||||
@property
|
||||
def device_class(self) -> str:
|
||||
"""Return the class of this device, from component DEVICE_CLASSES."""
|
||||
return 'light'
|
||||
return DEVICE_CLASS_ILLUMINANCE
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_update(self):
|
||||
|
||||
Reference in new issue
Block a user