Fix unit of illuminance in Plugwise illuminance sensor (#85392)

This commit is contained in:
Bouwe Westerdijk 2023-01-08 00:01:53 +01:00 committed by GitHub
parent ecaec0332d
commit da51765f5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -20,7 +20,6 @@ PW_TYPE: Final = "plugwise_type"
SMILE: Final = "smile"
STRETCH: Final = "stretch"
STRETCH_USERNAME: Final = "stretch"
UNIT_LUMEN: Final = "lm"
PLATFORMS_GATEWAY: Final[list[str]] = [
Platform.BINARY_SENSOR,

View file

@ -9,6 +9,7 @@ from homeassistant.components.sensor import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
LIGHT_LUX,
PERCENTAGE,
UnitOfEnergy,
UnitOfPower,
@ -20,7 +21,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN, UNIT_LUMEN
from .const import DOMAIN
from .coordinator import PlugwiseDataUpdateCoordinator
from .entity import PlugwiseEntity
@ -257,7 +258,8 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription(
key="illuminance",
name="Illuminance",
native_unit_of_measurement=UNIT_LUMEN,
native_unit_of_measurement=LIGHT_LUX,
device_class=SensorDeviceClass.ILLUMINANCE,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(