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" SMILE: Final = "smile"
STRETCH: Final = "stretch" STRETCH: Final = "stretch"
STRETCH_USERNAME: Final = "stretch" STRETCH_USERNAME: Final = "stretch"
UNIT_LUMEN: Final = "lm"
PLATFORMS_GATEWAY: Final[list[str]] = [ PLATFORMS_GATEWAY: Final[list[str]] = [
Platform.BINARY_SENSOR, Platform.BINARY_SENSOR,

View File

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