1
0
mirror of https://github.com/natekspencer/hacs-oasis_mini.git synced 2025-12-06 18:44:14 -05:00

Use tuples instead of sets for descriptors

This commit is contained in:
Nathan Spencer
2025-11-24 01:04:56 +00:00
parent aa7abc2174
commit a6ecd740be
4 changed files with 36 additions and 35 deletions

View File

@@ -49,7 +49,7 @@ async def async_setup_entry(
setup_platform_from_coordinator(entry, async_add_entities, make_entities) setup_platform_from_coordinator(entry, async_add_entities, make_entities)
DESCRIPTORS = { DESCRIPTORS = (
BinarySensorEntityDescription( BinarySensorEntityDescription(
key="busy", key="busy",
translation_key="busy", translation_key="busy",
@@ -63,7 +63,7 @@ DESCRIPTORS = {
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
} )
class OasisDeviceBinarySensorEntity(OasisDeviceEntity, BinarySensorEntity): class OasisDeviceBinarySensorEntity(OasisDeviceEntity, BinarySensorEntity):

View File

@@ -52,7 +52,7 @@ async def async_setup_entry(
setup_platform_from_coordinator(entry, async_add_entities, make_entities) setup_platform_from_coordinator(entry, async_add_entities, make_entities)
DESCRIPTORS = { DESCRIPTORS = (
NumberEntityDescription( NumberEntityDescription(
key="ball_speed", key="ball_speed",
translation_key="ball_speed", translation_key="ball_speed",
@@ -69,7 +69,7 @@ DESCRIPTORS = {
native_max_value=LED_SPEED_MAX, native_max_value=LED_SPEED_MAX,
native_min_value=LED_SPEED_MIN, native_min_value=LED_SPEED_MIN,
), ),
} )
class OasisDeviceNumberEntity(OasisDeviceEntity, NumberEntity): class OasisDeviceNumberEntity(OasisDeviceEntity, NumberEntity):

View File

@@ -51,7 +51,7 @@ async def async_setup_entry(
setup_platform_from_coordinator(entry, async_add_entities, make_entities) setup_platform_from_coordinator(entry, async_add_entities, make_entities)
DESCRIPTORS = { DESCRIPTORS = [
SensorEntityDescription( SensorEntityDescription(
key="download_progress", key="download_progress",
translation_key="download_progress", translation_key="download_progress",
@@ -68,7 +68,8 @@ DESCRIPTORS = {
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
suggested_display_precision=1, suggested_display_precision=1,
), ),
} | { ]
DESCRIPTORS.extend(
SensorEntityDescription( SensorEntityDescription(
key=key, key=key,
translation_key=key, translation_key=key,
@@ -77,7 +78,7 @@ DESCRIPTORS = {
) )
for key in ("error", "led_color_id", "status") for key in ("error", "led_color_id", "status")
# for key in ("error_message", "led_color_id", "status") # for key in ("error_message", "led_color_id", "status")
} )
class OasisDeviceSensorEntity(OasisDeviceEntity, SensorEntity): class OasisDeviceSensorEntity(OasisDeviceEntity, SensorEntity):

View File

@@ -49,13 +49,13 @@ async def async_setup_entry(
setup_platform_from_coordinator(entry, async_add_entities, make_entities) setup_platform_from_coordinator(entry, async_add_entities, make_entities)
DESCRIPTORS = { DESCRIPTORS = (
SwitchEntityDescription( SwitchEntityDescription(
key="auto_clean", key="auto_clean",
translation_key="auto_clean", translation_key="auto_clean",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
} )
class OasisDeviceSwitchEntity(OasisDeviceEntity, SwitchEntity): class OasisDeviceSwitchEntity(OasisDeviceEntity, SwitchEntity):