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

Classes

class  ElgatoSwitchEntity
 
class  ElgatoSwitchEntityDescription
 

Functions

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

Variables

list SWITCHES
 

Detailed Description

Support for Elgato switches.

Function Documentation

◆ async_setup_entry()

None homeassistant.components.elgato.switch.async_setup_entry ( HomeAssistant  hass,
ElgatorConfigEntry  entry,
AddEntitiesCallback  async_add_entities 
)
Set up Elgato switches based on a config entry.

Definition at line 53 of file switch.py.

Variable Documentation

◆ SWITCHES

list homeassistant.components.elgato.switch.SWITCHES
Initial value:
1 = [
2  ElgatoSwitchEntityDescription(
3  key="bypass",
4  translation_key="bypass",
5  entity_category=EntityCategory.CONFIG,
6  has_fn=lambda x: x.battery is not None,
7  is_on_fn=lambda x: x.settings.battery.bypass if x.settings.battery else None,
8  set_fn=lambda client, on: client.battery_bypass(on=on),
9  ),
10  ElgatoSwitchEntityDescription(
11  key="energy_saving",
12  translation_key="energy_saving",
13  entity_category=EntityCategory.CONFIG,
14  has_fn=lambda x: x.battery is not None,
15  is_on_fn=lambda x: (
16  x.settings.battery.energy_saving.enabled if x.settings.battery else None
17  ),
18  set_fn=lambda client, on: client.energy_saving(on=on),
19  ),
20 ]

Definition at line 31 of file switch.py.