Set entities to config category in SmartThings (#143669)

This commit is contained in:
Joost Lekkerkerker 2025-04-25 20:21:35 +02:00 committed by GitHub
parent 6a115d0133
commit 765a95c273
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 5 deletions

View File

@ -5,6 +5,7 @@ from __future__ import annotations
from pysmartthings import Attribute, Capability, Command, SmartThings from pysmartthings import Attribute, Capability, Command, SmartThings
from homeassistant.components.number import NumberEntity, NumberMode from homeassistant.components.number import NumberEntity, NumberMode
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
@ -33,6 +34,7 @@ class SmartThingsWasherRinseCyclesNumberEntity(SmartThingsEntity, NumberEntity):
_attr_translation_key = "washer_rinse_cycles" _attr_translation_key = "washer_rinse_cycles"
_attr_native_step = 1.0 _attr_native_step = 1.0
_attr_mode = NumberMode.BOX _attr_mode = NumberMode.BOX
_attr_entity_category = EntityCategory.CONFIG
def __init__(self, client: SmartThings, device: FullDevice) -> None: def __init__(self, client: SmartThings, device: FullDevice) -> None:
"""Initialize the instance.""" """Initialize the instance."""

View File

@ -12,6 +12,7 @@ from homeassistant.components.switch import (
SwitchEntity, SwitchEntity,
SwitchEntityDescription, SwitchEntityDescription,
) )
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
@ -69,6 +70,7 @@ CAPABILITY_TO_COMMAND_SWITCHES: dict[
translation_key="wrinkle_prevent", translation_key="wrinkle_prevent",
status_attribute=Attribute.DRYER_WRINKLE_PREVENT, status_attribute=Attribute.DRYER_WRINKLE_PREVENT,
command=Command.SET_DRYER_WRINKLE_PREVENT, command=Command.SET_DRYER_WRINKLE_PREVENT,
entity_category=EntityCategory.CONFIG,
) )
} }
CAPABILITY_TO_SWITCHES: dict[Capability | str, SmartThingsSwitchEntityDescription] = { CAPABILITY_TO_SWITCHES: dict[Capability | str, SmartThingsSwitchEntityDescription] = {
@ -76,6 +78,7 @@ CAPABILITY_TO_SWITCHES: dict[Capability | str, SmartThingsSwitchEntityDescriptio
key=Capability.SAMSUNG_CE_WASHER_BUBBLE_SOAK, key=Capability.SAMSUNG_CE_WASHER_BUBBLE_SOAK,
translation_key="bubble_soak", translation_key="bubble_soak",
status_attribute=Attribute.STATUS, status_attribute=Attribute.STATUS,
entity_category=EntityCategory.CONFIG,
), ),
Capability.SWITCH: SmartThingsSwitchEntityDescription( Capability.SWITCH: SmartThingsSwitchEntityDescription(
key=Capability.SWITCH, key=Capability.SWITCH,

View File

@ -16,7 +16,7 @@
'device_id': <ANY>, 'device_id': <ANY>,
'disabled_by': None, 'disabled_by': None,
'domain': 'number', 'domain': 'number',
'entity_category': None, 'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.washer_rinse_cycles', 'entity_id': 'number.washer_rinse_cycles',
'has_entity_name': True, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
@ -73,7 +73,7 @@
'device_id': <ANY>, 'device_id': <ANY>,
'disabled_by': None, 'disabled_by': None,
'domain': 'number', 'domain': 'number',
'entity_category': None, 'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.washing_machine_rinse_cycles', 'entity_id': 'number.washing_machine_rinse_cycles',
'has_entity_name': True, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,

View File

@ -246,7 +246,7 @@
'device_id': <ANY>, 'device_id': <ANY>,
'disabled_by': None, 'disabled_by': None,
'domain': 'switch', 'domain': 'switch',
'entity_category': None, 'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.dryer_wrinkle_prevent', 'entity_id': 'switch.dryer_wrinkle_prevent',
'has_entity_name': True, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
@ -293,7 +293,7 @@
'device_id': <ANY>, 'device_id': <ANY>,
'disabled_by': None, 'disabled_by': None,
'domain': 'switch', 'domain': 'switch',
'entity_category': None, 'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.seca_roupa_wrinkle_prevent', 'entity_id': 'switch.seca_roupa_wrinkle_prevent',
'has_entity_name': True, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
@ -340,7 +340,7 @@
'device_id': <ANY>, 'device_id': <ANY>,
'disabled_by': None, 'disabled_by': None,
'domain': 'switch', 'domain': 'switch',
'entity_category': None, 'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.washing_machine_bubble_soak', 'entity_id': 'switch.washing_machine_bubble_soak',
'has_entity_name': True, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,