1 """Support for interacting with UpCloud servers."""
12 from .const
import DATA_UPCLOUD
13 from .entity
import UpCloudServerEntity
15 SIGNAL_UPDATE_UPCLOUD =
"upcloud_update"
20 config_entry: ConfigEntry,
21 async_add_entities: AddEntitiesCallback,
23 """Set up the UpCloud server switch."""
24 coordinator = hass.data[DATA_UPCLOUD].coordinators[config_entry.data[CONF_USERNAME]]
25 entities = [
UpCloudSwitch(coordinator, uuid)
for uuid
in coordinator.data]
30 """Representation of an UpCloud server switch."""
33 """Start the server."""
39 """Stop the server."""
upcloud_api.Server _server(self)
None turn_on(self, **Any kwargs)
None turn_off(self, **Any kwargs)
Literal["on", "off"]|None state(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
None dispatcher_send(HomeAssistant hass, str signal, *Any args)