Add support for light sensors with 'lx' unit to HomeKit (#14131)

* add support for light sensors with lx unit

* add test for light sensor with 'lx' unit
This commit is contained in:
Maciej Bieniek authored and Fabian Affolter committed 2018-04-28 17:14:34 +02:00
1 parent 8bc497ba1d
commit c78e8eb578
2 files changed
+8 -1

No files matched your search

@@ -125,6 +125,13 @@ class TestGetAccessories(unittest.TestCase):
{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}):
state = State('sensor.light', '900',
{ATTR_UNIT_OF_MEASUREMENT: 'lx'})
get_accessory(None, state, 2, {})
def test_binary_sensor(self):
"""Test binary sensor with opening class."""
with patch.dict(TYPES, {'BinarySensor': self.mock_type}):