diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py index 9fd8892b977..e81d3a9655f 100644 --- a/homeassistant/components/zha/sensor.py +++ b/homeassistant/components/zha/sensor.py @@ -403,9 +403,9 @@ class Illuminance(Sensor): _attr_name: str = "Illuminance" _attr_native_unit_of_measurement = LIGHT_LUX - def formatter(self, value: int) -> float: + def formatter(self, value: int) -> int: """Convert illumination data.""" - return round(pow(10, ((value - 1) / 10000)), 1) + return round(pow(10, ((value - 1) / 10000))) @MULTI_MATCH( diff --git a/tests/components/zha/test_sensor.py b/tests/components/zha/test_sensor.py index 55ea9833caa..dec065936a1 100644 --- a/tests/components/zha/test_sensor.py +++ b/tests/components/zha/test_sensor.py @@ -129,7 +129,7 @@ async def async_test_pressure(hass, cluster, entity_id): async def async_test_illuminance(hass, cluster, entity_id): """Test illuminance sensor.""" await send_attributes_report(hass, cluster, {1: 1, 0: 10, 2: 20}) - assert_state(hass, entity_id, "1.0", LIGHT_LUX) + assert_state(hass, entity_id, "1", LIGHT_LUX) async def async_test_metering(hass, cluster, entity_id):