Skip to content

Commit

Permalink
Set unit of measurement for Illuminance device class. #243
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed May 24, 2024
1 parent 223e9c0 commit b129b86
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/localtuya/core/ha_entities/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
UnitOfVolume,
UnitOfElectricPotential,
DEGREE,
LIGHT_LUX,
)

from .base import (
Expand Down Expand Up @@ -651,6 +652,7 @@ def localtuya_sensor(unit_of_measurement=None, scale_factor: float = 1) -> dict:
entity_category=EntityCategory.DIAGNOSTIC,
device_class=SensorDeviceClass.ILLUMINANCE,
state_class=SensorStateClass.MEASUREMENT,
custom_configs=localtuya_sensor(LIGHT_LUX),
),
*BATTERY_SENSORS,
),
Expand Down Expand Up @@ -903,6 +905,7 @@ def localtuya_sensor(unit_of_measurement=None, scale_factor: float = 1) -> dict:
name="Illuminance",
device_class=SensorDeviceClass.ILLUMINANCE,
state_class=SensorStateClass.MEASUREMENT,
custom_configs=localtuya_sensor(LIGHT_LUX),
),
*BATTERY_SENSORS,
),
Expand Down

0 comments on commit b129b86

Please sign in to comment.