Skip to content

Commit

Permalink
Fix device_class type for Shelly Gen1 sleeping sensors (home-assist…
Browse files Browse the repository at this point in the history
  • Loading branch information
bieniu authored and catsmanac committed Jan 10, 2024
1 parent fab9933 commit 9e8f52c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion homeassistant/components/shelly/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.entity_registry import RegistryEntry
from homeassistant.helpers.typing import StateType
from homeassistant.util.enum import try_parse_enum

from .const import CONF_SLEEP_PERIOD, SHAIR_MAX_WORK_HOURS
from .coordinator import ShellyBlockCoordinator, ShellyRpcCoordinator
Expand Down Expand Up @@ -969,7 +970,7 @@ def _build_block_description(entry: RegistryEntry) -> BlockSensorDescription:
name="",
icon=entry.original_icon,
native_unit_of_measurement=entry.unit_of_measurement,
device_class=entry.original_device_class,
device_class=try_parse_enum(SensorDeviceClass, entry.original_device_class),
)


Expand Down

0 comments on commit 9e8f52c

Please sign in to comment.