mirror of
https://github.com/home-assistant/core
synced 2024-07-25 12:44:07 +00:00
Move Auto On/off switches to Config EntityCategory (#120648)
This commit is contained in:
parent
5634741ce2
commit
85629dc31e
|
@ -9,6 +9,7 @@ from lmcloud.lm_machine import LaMarzoccoMachine
|
||||||
from lmcloud.models import LaMarzoccoMachineConfig
|
from lmcloud.models import LaMarzoccoMachineConfig
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
|
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
|
||||||
|
from homeassistant.const import EntityCategory
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
|
@ -105,6 +106,7 @@ class LaMarzoccoAutoOnOffSwitchEntity(LaMarzoccoBaseEntity, SwitchEntity):
|
||||||
super().__init__(coordinator, f"auto_on_off_{identifier}")
|
super().__init__(coordinator, f"auto_on_off_{identifier}")
|
||||||
self._identifier = identifier
|
self._identifier = identifier
|
||||||
self._attr_translation_placeholders = {"id": identifier}
|
self._attr_translation_placeholders = {"id": identifier}
|
||||||
|
self.entity_category = EntityCategory.CONFIG
|
||||||
|
|
||||||
async def _async_enable(self, state: bool) -> None:
|
async def _async_enable(self, state: bool) -> None:
|
||||||
"""Enable or disable the auto on/off schedule."""
|
"""Enable or disable the auto on/off schedule."""
|
||||||
|
|
|
@ -10,7 +10,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.gs01234_auto_on_off_os2oswx',
|
'entity_id': 'switch.gs01234_auto_on_off_os2oswx',
|
||||||
'has_entity_name': True,
|
'has_entity_name': True,
|
||||||
'hidden_by': None,
|
'hidden_by': None,
|
||||||
|
@ -43,7 +43,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.gs01234_auto_on_off_axfz5bj',
|
'entity_id': 'switch.gs01234_auto_on_off_axfz5bj',
|
||||||
'has_entity_name': True,
|
'has_entity_name': True,
|
||||||
'hidden_by': None,
|
'hidden_by': None,
|
||||||
|
|
Loading…
Reference in a new issue