mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
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 (<class 'homeassistant.components.wiffi.sensor.NumberEntity'>) 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 ```
This commit is contained in:
parent
65f660b7d4
commit
329d50865a
@ -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,
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user