Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.pvpc_hourly_pricing.helpers Namespace Reference

Functions

set[str] get_enabled_sensor_keys (bool using_private_api, list[RegistryEntry] entries)
 
str make_sensor_unique_id (str|None config_entry_id, str sensor_key)
 

Variables

dictionary _ha_uniqueid_to_sensor_key
 

Detailed Description

Helper functions to relate sensors keys and unique ids.

Function Documentation

◆ get_enabled_sensor_keys()

set[str] homeassistant.components.pvpc_hourly_pricing.helpers.get_enabled_sensor_keys ( bool  using_private_api,
list[RegistryEntry]   entries 
)
Get enabled API indicators.

Definition at line 26 of file helpers.py.

◆ make_sensor_unique_id()

str homeassistant.components.pvpc_hourly_pricing.helpers.make_sensor_unique_id ( str | None  config_entry_id,
str  sensor_key 
)
Generate unique_id for each sensor kind and config entry.

Definition at line 43 of file helpers.py.

Variable Documentation

◆ _ha_uniqueid_to_sensor_key

dictionary homeassistant.components.pvpc_hourly_pricing.helpers._ha_uniqueid_to_sensor_key
private
Initial value:
1 = {
2  TARIFFS[0]: KEY_PVPC,
3  TARIFFS[1]: KEY_PVPC,
4  f"{TARIFFS[0]}_{KEY_INJECTION}": KEY_INJECTION,
5  f"{TARIFFS[1]}_{KEY_INJECTION}": KEY_INJECTION,
6  f"{TARIFFS[0]}_{KEY_MAG}": KEY_MAG,
7  f"{TARIFFS[1]}_{KEY_MAG}": KEY_MAG,
8  f"{TARIFFS[0]}_{KEY_OMIE}": KEY_OMIE,
9  f"{TARIFFS[1]}_{KEY_OMIE}": KEY_OMIE,
10 }

Definition at line 14 of file helpers.py.