Refactor group to extend domains that can be grouped (#40607)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
e7d8742771
commit
9ccebdb8d5
24 changed files with 1006 additions and 210 deletions
20
homeassistant/components/climate/group.py
Normal file
20
homeassistant/components/climate/group.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
"""Describe group states."""
|
||||
|
||||
|
||||
from homeassistant.components.group import GroupIntegrationRegistry
|
||||
from homeassistant.const import STATE_OFF
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
|
||||
from .const import HVAC_MODE_OFF, HVAC_MODES
|
||||
|
||||
|
||||
@callback
|
||||
def async_describe_on_off_states(
|
||||
hass: HomeAssistantType, registry: GroupIntegrationRegistry
|
||||
) -> None:
|
||||
"""Describe group on off states."""
|
||||
registry.on_off_states(
|
||||
set(HVAC_MODES) - {HVAC_MODE_OFF},
|
||||
STATE_OFF,
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue