1 """Support for the Hive switches."""
3 from __future__
import annotations
5 from datetime
import timedelta
8 from apyhiveapi
import Hive
16 from .
import refresh_system
17 from .const
import ATTR_MODE, DOMAIN
18 from .entity
import HiveEntity
24 SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
29 key=
"Heating_Heat_On_Demand",
30 entity_category=EntityCategory.CONFIG,
36 hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
38 """Set up Hive thermostat based on a config entry."""
40 hive = hass.data[DOMAIN][entry.entry_id]
41 devices = hive.session.deviceList.get(
"switch")
48 for description
in SWITCH_TYPES
49 if dev[
"hiveType"] == description.key
56 """Hive Active Plug."""
61 hive_device: dict[str, Any],
62 entity_description: SwitchEntityDescription,
64 """Initialise hive switch."""
70 """Turn the switch on."""
75 """Turn the device off."""
79 """Update all Node data from Hive."""
84 ATTR_MODE: self.attributes.
get(ATTR_MODE),
None __init__(self, Hive hive, dict[str, Any] hive_device, SwitchEntityDescription entity_description)
None async_turn_off(self, **Any kwargs)
_attr_extra_state_attributes
None async_turn_on(self, **Any kwargs)
web.Response get(self, web.Request request, str config_key)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)
IssData update(pyiss.ISS iss)