Skip to content

Commit

Permalink
fix: properly initialize select entities
Browse files Browse the repository at this point in the history
  • Loading branch information
Michsior14 committed Feb 25, 2024
1 parent 23552a1 commit 48ae9ef
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion custom_components/venta/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ async def async_setup_entry(
entities = [
VentaBinarySensor(coordinator, description)
for description in _supported_sensors(coordinator.api.device.device_type)
if description.key
]
async_add_entities(entities)

Expand Down
4 changes: 2 additions & 2 deletions custom_components/venta/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class VentaSelectEntityDescription(
"""Describes Venta select entity."""


SENSOR_TYPES: tuple[SelectEntityDescription, ...] = (
SENSOR_TYPES: list[VentaSelectEntityDescription] = (
VentaSelectEntityDescription(
key=ATTR_LED_STRIP_MODE,
translation_key="led_strip_mode",
Expand Down Expand Up @@ -76,7 +76,7 @@ async def async_setup_entry(
entities = [
VentaSelect(coordinator, description)
for description in SENSOR_TYPES
if description.key in description.exists_func(coordinator)
if description.exists_func(coordinator)
]
async_add_entities(entities)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/venta/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class VentaSensorEntityDescription(
suggested_display_precision = 0


SENSOR_TYPES: tuple[VentaSensorEntityDescription, ...] = (
SENSOR_TYPES: list[VentaSensorEntityDescription] = (
VentaSensorEntityDescription(
key=ATTR_TEMPERATURE,
translation_key="temperature",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/venta/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class VentaSwitchEntityDescription(
"""Describes Venta switch entity."""


SENSOR_TYPES: tuple[VentaSwitchEntityDescription, ...] = (
SENSOR_TYPES: list[VentaSwitchEntityDescription] = (
VentaSwitchEntityDescription(
key=ATTR_SLEEP_MODE,
translation_key="sleep_mode",
Expand Down

0 comments on commit 48ae9ef

Please sign in to comment.