mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Round illuminance value in ZHA integration (#84500)
This commit is contained in:
parent
e2e272aeb6
commit
a8f09b4063
@ -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(
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user