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

@@ -99,10 +99,10 @@ class TestGetAccessories(unittest.TestCase):
get_accessory(None, state, 2, {})
def test_light_sensor(self):
"""Test light sensor with device class lux."""
"""Test light sensor with device class illuminance."""
with patch.dict(TYPES, {'LightSensor': self.mock_type}):
state = State('sensor.light', '900',
{ATTR_DEVICE_CLASS: 'light'})
{ATTR_DEVICE_CLASS: 'illuminance'})
get_accessory(None, state, 2, {})
def test_light_sensor_unit_lm(self):
@@ -112,13 +112,6 @@ class TestGetAccessories(unittest.TestCase):
{ATTR_UNIT_OF_MEASUREMENT: 'lm'})
get_accessory(None, state, 2, {})
def test_light_sensor_unit_lux(self):
"""Test light sensor with lux as unit."""
with patch.dict(TYPES, {'LightSensor': self.mock_type}):
state = State('sensor.light', '900',
{ATTR_UNIT_OF_MEASUREMENT: 'lux'})
get_accessory(None, state, 2, {})
def test_light_sensor_unit_lx(self):
"""Test light sensor with lx as unit."""
with patch.dict(TYPES, {'LightSensor': self.mock_type}):