Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.environment_canada.weather Namespace Reference

Classes

class  ECWeather
 

Functions

str _calculate_unique_id (str|None config_entry_unique_id, bool hourly)
 
None async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
list[Forecast]|None get_forecast (ec_data, hourly)
 
def icon_code_to_condition (icon_code)
 

Variables

dictionary ICON_CONDITION_MAP
 

Detailed Description

Platform for retrieving meteorological data from Environment Canada.

Function Documentation

◆ _calculate_unique_id()

str homeassistant.components.environment_canada.weather._calculate_unique_id ( str | None  config_entry_unique_id,
bool  hourly 
)
private
Calculate unique ID.

Definition at line 82 of file weather.py.

◆ async_setup_entry()

None homeassistant.components.environment_canada.weather.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Add a weather entity from a config_entry.

Definition at line 62 of file weather.py.

◆ get_forecast()

list[Forecast] | None homeassistant.components.environment_canada.weather.get_forecast (   ec_data,
  hourly 
)
Build the forecast array.

Definition at line 187 of file weather.py.

◆ icon_code_to_condition()

def homeassistant.components.environment_canada.weather.icon_code_to_condition (   icon_code)
Return the condition corresponding to an icon code.

Definition at line 232 of file weather.py.

Variable Documentation

◆ ICON_CONDITION_MAP

dictionary homeassistant.components.environment_canada.weather.ICON_CONDITION_MAP
Initial value:
1 = {
2  ATTR_CONDITION_SUNNY: [0, 1],
3  ATTR_CONDITION_CLEAR_NIGHT: [30, 31],
4  ATTR_CONDITION_PARTLYCLOUDY: [2, 3, 4, 5, 22, 32, 33, 34, 35],
5  ATTR_CONDITION_CLOUDY: [10],
6  ATTR_CONDITION_RAINY: [6, 9, 11, 12, 28, 36],
7  ATTR_CONDITION_LIGHTNING_RAINY: [19, 39, 46, 47],
8  ATTR_CONDITION_POURING: [13],
9  ATTR_CONDITION_SNOWY_RAINY: [7, 14, 15, 27, 37],
10  ATTR_CONDITION_SNOWY: [8, 16, 17, 18, 25, 26, 38, 40],
11  ATTR_CONDITION_WINDY: [43],
12  ATTR_CONDITION_FOG: [20, 21, 23, 24, 44],
13  ATTR_CONDITION_HAIL: [26, 27],
14 }

Definition at line 46 of file weather.py.