From 329d50865a226910c827d5e4ba26b0f240fed6c2 Mon Sep 17 00:00:00 2001 From: Steffen Zimmermann Date: Sun, 5 Feb 2023 03:11:52 +0100 Subject: [PATCH] Use official unit of measure for Lux in wiffi component (#87377) use official unit of measure for Lux in wiffi component Add a mapping for the wiffi unit of illuminance 'lux' to the Home Assistant unit 'lx'. This fixed the following warning during startup: ``` 2023-02-04 10:28:30.653 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.helligkeit () is using native unit of measurement 'lux' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+wiffi%22 ``` --- homeassistant/components/wiffi/sensor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/wiffi/sensor.py b/homeassistant/components/wiffi/sensor.py index b53a9140857..1036ac7986f 100644 --- a/homeassistant/components/wiffi/sensor.py +++ b/homeassistant/components/wiffi/sensor.py @@ -5,7 +5,7 @@ from homeassistant.components.sensor import ( SensorStateClass, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import DEGREE, UnitOfPressure, UnitOfTemperature +from homeassistant.const import DEGREE, LIGHT_LUX, UnitOfPressure, UnitOfTemperature from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -33,6 +33,7 @@ UOM_MAP = { WIFFI_UOM_DEGREE: DEGREE, WIFFI_UOM_TEMP_CELSIUS: UnitOfTemperature.CELSIUS, WIFFI_UOM_MILLI_BAR: UnitOfPressure.MBAR, + WIFFI_UOM_LUX: LIGHT_LUX, }