1 """Support for Goal Zero Yeti Switches."""
3 from __future__
import annotations
5 from typing
import Any, cast
11 from .coordinator
import GoalZeroConfigEntry
12 from .entity
import GoalZeroEntity
14 SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
17 translation_key=
"v12_port_status",
21 translation_key=
"usb_port_status",
25 translation_key=
"ac_port_status",
32 entry: GoalZeroConfigEntry,
33 async_add_entities: AddEntitiesCallback,
35 """Set up the Goal Zero Yeti switch."""
37 GoalZeroSwitch(entry.runtime_data, description)
for description
in SWITCH_TYPES
42 """Representation of a Goal Zero Yeti switch."""
46 """Return state of the switch."""
50 """Turn off the switch."""
52 await self.
_api_api.post_state(payload=payload)
56 """Turn on the switch."""
58 await self.
_api_api.post_state(payload=payload)
None async_turn_off(self, **Any kwargs)
None async_turn_on(self, **Any kwargs)
None async_set_updated_data(self, _DataT data)
None async_setup_entry(HomeAssistant hass, GoalZeroConfigEntry entry, AddEntitiesCallback async_add_entities)