Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.homewizard.switch Namespace Reference

Classes

class  HomeWizardSwitchEntity
 
class  HomeWizardSwitchEntityDescription
 

Functions

None async_setup_entry (HomeAssistant hass, HomeWizardConfigEntry entry, AddEntitiesCallback async_add_entities)
 

Variables

int PARALLEL_UPDATES = 1
 
list SWITCHES
 

Detailed Description

Creates HomeWizard Energy switch entities.

Function Documentation

◆ async_setup_entry()

None homeassistant.components.homewizard.switch.async_setup_entry ( HomeAssistant  hass,
HomeWizardConfigEntry  entry,
AddEntitiesCallback  async_add_entities 
)
Set up switches.

Definition at line 70 of file switch.py.

Variable Documentation

◆ PARALLEL_UPDATES

int homeassistant.components.homewizard.switch.PARALLEL_UPDATES = 1

Definition at line 26 of file switch.py.

◆ SWITCHES

list homeassistant.components.homewizard.switch.SWITCHES
Initial value:
1 = [
2  HomeWizardSwitchEntityDescription(
3  key="power_on",
4  name=None,
5  device_class=SwitchDeviceClass.OUTLET,
6  create_fn=lambda coordinator: coordinator.supports_state(),
7  available_fn=lambda data: data.state is not None and not data.state.switch_lock,
8  is_on_fn=lambda data: data.state.power_on if data.state else None,
9  set_fn=lambda api, active: api.state_set(power_on=active),
10  ),
11  HomeWizardSwitchEntityDescription(
12  key="switch_lock",
13  translation_key="switch_lock",
14  entity_category=EntityCategory.CONFIG,
15  create_fn=lambda coordinator: coordinator.supports_state(),
16  available_fn=lambda data: data.state is not None,
17  is_on_fn=lambda data: data.state.switch_lock if data.state else None,
18  set_fn=lambda api, active: api.state_set(switch_lock=active),
19  ),
20  HomeWizardSwitchEntityDescription(
21  key="cloud_connection",
22  translation_key="cloud_connection",
23  entity_category=EntityCategory.CONFIG,
24  create_fn=lambda _: True,
25  available_fn=lambda data: data.system is not None,
26  is_on_fn=lambda data: data.system.cloud_enabled if data.system else None,
27  set_fn=lambda api, active: api.system_set(cloud_enabled=active),
28  ),
29 ]

Definition at line 39 of file switch.py.