Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.weather.WeatherEntity Class Reference
Inheritance diagram for homeassistant.components.weather.WeatherEntity:
[legend]
Collaboration diagram for homeassistant.components.weather.WeatherEntity:
[legend]

Public Member Functions

None __post_init__ (self, *Any args, **Any kwargs)
 
list[Forecast]|None async_forecast_daily (self)
 
list[Forecast]|None async_forecast_hourly (self)
 
list[Forecast]|None async_forecast_twice_daily (self)
 
None async_internal_added_to_hass (self)
 
None async_registry_entry_updated (self)
 
CALLBACK_TYPE async_subscribe_forecast (self, Literal["daily", "hourly", "twice_daily"] forecast_type, Callable[[list[JsonValueType]|None], None] forecast_listener)
 
None async_update_listeners (self, Iterable[Literal["daily", "hourly", "twice_daily"]]|None forecast_types)
 
float|None cloud_coverage (self)
 
str|None condition (self)
 
float|None humidity (self)
 
float|None native_apparent_temperature (self)
 
float|None native_dew_point (self)
 
str|None native_precipitation_unit (self)
 
float|None native_pressure (self)
 
str|None native_pressure_unit (self)
 
float|None native_temperature (self)
 
str|None native_temperature_unit (self)
 
float|None native_visibility (self)
 
str|None native_visibility_unit (self)
 
float|None native_wind_gust_speed (self)
 
float|None native_wind_speed (self)
 
str|None native_wind_speed_unit (self)
 
float|None ozone (self)
 
float precision (self)
 
str|None state (self)
 
dict[str, Any] state_attributes (self)
 
float|None uv_index (self)
 
float|str|None wind_bearing (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (self)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
None add_to_platform_start (self, HomeAssistant hass, EntityPlatform platform, asyncio.Semaphore|None parallel_updates)
 
bool assumed_state (self)
 
None async_added_to_hass (self)
 
None async_device_update (self, bool warning=True)
 
None async_internal_will_remove_from_hass (self)
 
None async_on_remove (self, CALLBACK_TYPE func)
 
None async_remove (self, *bool force_remove=False)
 
None async_removed_from_registry (self)
 
None async_schedule_update_ha_state (self, bool force_refresh=False)
 
None async_set_context (self, Context context)
 
None async_update_ha_state (self, bool force_refresh=False)
 
None async_will_remove_from_hass (self)
 
None async_write_ha_state (self)
 
str|None attribution (self)
 
bool available (self)
 
dict[str, Any]|None capability_attributes (self)
 
str|None device_class (self)
 
DeviceInfo|None device_info (self)
 
bool enabled (self)
 
EntityCategory|None entity_category (self)
 
str|None entity_picture (self)
 
bool entity_registry_enabled_default (self)
 
bool entity_registry_visible_default (self)
 
Mapping[str, Any]|None extra_state_attributes (self)
 
bool force_update (self)
 
HassJobType get_hassjob_type (self, str function_name)
 
er.EntityOptionsType|None get_initial_entity_options (self)
 
bool has_entity_name (self)
 
str|None icon (self)
 
str|UndefinedType|None name (self)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (self)
 
str|None suggested_object_id (self)
 
int|None supported_features (self)
 
str|None translation_key (self)
 
Mapping[str, strtranslation_placeholders (self)
 
str|None unique_id (self)
 
str|None unit_of_measurement (self)
 
bool use_device_name (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.CachedProperties
None __init__ (cls, str name, tuple[type,...] bases, dict[Any, Any] namespace, **Any kwargs)
 
Any __new__ (mcs, str name, tuple[type,...] bases, dict[Any, Any] namespace, set[str]|None cached_properties=None, **Any kwargs)
 
- Public Member Functions inherited from homeassistant.components.weather.PostInitMeta
Any __call__ (cls, *Any args, **Any kwargs)
 

Static Public Attributes

 None
 
- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 

Private Member Functions

None _async_subscription_ended (self, Literal["daily", "hourly", "twice_daily"] forecast_type)
 
None _async_subscription_started (self, Literal["daily", "hourly", "twice_daily"] forecast_type)
 
list[JsonValueType] _convert_forecast (self, list[Forecast] native_forecast_list)
 
str _default_precipitation_unit (self)
 
str _default_pressure_unit (self)
 
str _default_temperature_unit (self)
 
str _default_visibility_unit (self)
 
str _default_wind_speed_unit (self)
 
str _precipitation_unit (self)
 
str _pressure_unit (self)
 
str _temperature_unit (self)
 
str _visibility_unit (self)
 
str _wind_speed_unit (self)
 

Private Attributes

 _forecast_listeners
 
 _temperature_unit
 
 _weather_option_precipitation_unit
 
 _weather_option_pressure_unit
 
 _weather_option_temperature_unit
 
 _weather_option_visibility_unit
 
 _weather_option_wind_speed_unit
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Detailed Description

ABC for weather data.

Definition at line 274 of file __init__.py.

Member Function Documentation

◆ __post_init__()

None homeassistant.components.weather.WeatherEntity.__post_init__ (   self,
*Any  args,
**Any  kwargs 
)
Finish initializing.

Reimplemented from homeassistant.components.weather.PostInit.

Definition at line 311 of file __init__.py.

◆ _async_subscription_ended()

None homeassistant.components.weather.WeatherEntity._async_subscription_ended (   self,
Literal["daily", "hourly", "twice_daily"]  forecast_type 
)
private
End subscription to forecast_type.

Reimplemented in homeassistant.components.weather.CoordinatorWeatherEntity.

Definition at line 928 of file __init__.py.

◆ _async_subscription_started()

None homeassistant.components.weather.WeatherEntity._async_subscription_started (   self,
Literal["daily", "hourly", "twice_daily"]  forecast_type 
)
private
Start subscription to forecast_type.

Reimplemented in homeassistant.components.weather.CoordinatorWeatherEntity.

Definition at line 921 of file __init__.py.

◆ _convert_forecast()

list[JsonValueType] homeassistant.components.weather.WeatherEntity._convert_forecast (   self,
list[Forecast]   native_forecast_list 
)
private
Convert a forecast in native units to the unit configured by the user.

Definition at line 683 of file __init__.py.

◆ _default_precipitation_unit()

str homeassistant.components.weather.WeatherEntity._default_precipitation_unit (   self)
private
Return the default unit of measurement for precipitation.

Should not be set by integrations.

Definition at line 517 of file __init__.py.

◆ _default_pressure_unit()

str homeassistant.components.weather.WeatherEntity._default_pressure_unit (   self)
private
Return the default unit of measurement for pressure.

Should not be set by integrations.

Definition at line 377 of file __init__.py.

◆ _default_temperature_unit()

str homeassistant.components.weather.WeatherEntity._default_temperature_unit (   self)
private
Return the default unit of measurement for temperature.

Should not be set by integrations.

Definition at line 344 of file __init__.py.

◆ _default_visibility_unit()

str homeassistant.components.weather.WeatherEntity._default_visibility_unit (   self)
private
Return the default unit of measurement for visibility.

Should not be set by integrations.

Definition at line 477 of file __init__.py.

◆ _default_wind_speed_unit()

str homeassistant.components.weather.WeatherEntity._default_wind_speed_unit (   self)
private
Return the default unit of measurement for wind speed.

Should not be set by integrations.

Definition at line 422 of file __init__.py.

◆ _precipitation_unit()

str homeassistant.components.weather.WeatherEntity._precipitation_unit (   self)
private
Return the converted unit of measurement for precipitation.

Should not be set by integrations.

Definition at line 526 of file __init__.py.

◆ _pressure_unit()

str homeassistant.components.weather.WeatherEntity._pressure_unit (   self)
private
Return the converted unit of measurement for pressure.

Should not be set by integrations.

Definition at line 388 of file __init__.py.

◆ _temperature_unit()

str homeassistant.components.weather.WeatherEntity._temperature_unit (   self)
private
Return the converted unit of measurement for temperature.

Should not be set by integrations.

Definition at line 353 of file __init__.py.

◆ _visibility_unit()

str homeassistant.components.weather.WeatherEntity._visibility_unit (   self)
private
Return the converted unit of measurement for visibility.

Should not be set by integrations.

Definition at line 486 of file __init__.py.

◆ _wind_speed_unit()

str homeassistant.components.weather.WeatherEntity._wind_speed_unit (   self)
private
Return the converted unit of measurement for wind speed.

Should not be set by integrations.

Definition at line 433 of file __init__.py.

◆ async_forecast_daily()

◆ async_forecast_hourly()

◆ async_forecast_twice_daily()

◆ async_internal_added_to_hass()

None homeassistant.components.weather.WeatherEntity.async_internal_added_to_hass (   self)
Call when the weather entity is added to hass.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 315 of file __init__.py.

◆ async_registry_entry_updated()

None homeassistant.components.weather.WeatherEntity.async_registry_entry_updated (   self)
Run when the entity registry entry has been updated.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 880 of file __init__.py.

◆ async_subscribe_forecast()

CALLBACK_TYPE homeassistant.components.weather.WeatherEntity.async_subscribe_forecast (   self,
Literal["daily", "hourly", "twice_daily"]  forecast_type,
Callable[[list[JsonValueType] | None], None forecast_listener 
)
Subscribe to forecast updates.

Called by websocket API.

Definition at line 936 of file __init__.py.

◆ async_update_listeners()

None homeassistant.components.weather.WeatherEntity.async_update_listeners (   self,
Iterable[Literal["daily", "hourly", "twice_daily"]] | None   forecast_types 
)
Push updated forecast to all listeners.

Definition at line 959 of file __init__.py.

◆ cloud_coverage()

◆ condition()

str | None homeassistant.components.weather.WeatherEntity.condition (   self)
Return the current condition.

Reimplemented in homeassistant.components.weatherkit.weather.WeatherKitWeather, homeassistant.components.weatherflow_cloud.weather.WeatherFlowWeather, homeassistant.components.tomorrowio.weather.TomorrowioWeatherEntity, homeassistant.components.template.weather.TriggerWeatherEntity, homeassistant.components.template.weather.WeatherTemplate, homeassistant.components.openweathermap.weather.OpenWeatherMapWeather, homeassistant.components.open_meteo.weather.OpenMeteoWeatherEntity, homeassistant.components.nws.weather.NWSWeather, homeassistant.components.metoffice.weather.MetOfficeWeather, homeassistant.components.meteoclimatic.weather.MeteoclimaticWeather, homeassistant.components.meteo_france.weather.MeteoFranceWeather, homeassistant.components.met_eireann.weather.MetEireannWeather, homeassistant.components.met.weather.MetWeather, homeassistant.components.knx.weather.KNXWeather, homeassistant.components.kitchen_sink.weather.DemoWeather, homeassistant.components.ipma.weather.IPMAWeather, homeassistant.components.homematicip_cloud.weather.HomematicipHomeWeather, homeassistant.components.homematicip_cloud.weather.HomematicipWeatherSensor, homeassistant.components.hko.weather.HKOEntity, homeassistant.components.environment_canada.weather.ECWeather, homeassistant.components.ecobee.weather.EcobeeWeather, homeassistant.components.demo.weather.DemoWeather, homeassistant.components.aemet.weather.AemetWeather, and homeassistant.components.accuweather.weather.AccuWeatherEntity.

Definition at line 875 of file __init__.py.

◆ humidity()

float | None homeassistant.components.weather.WeatherEntity.humidity (   self)
Return the humidity in native units.

Reimplemented in homeassistant.components.zamg.weather.ZamgWeather, homeassistant.components.weatherkit.weather.WeatherKitWeather, homeassistant.components.weatherflow_cloud.weather.WeatherFlowWeather, homeassistant.components.tomorrowio.weather.TomorrowioWeatherEntity, homeassistant.components.template.weather.TriggerWeatherEntity, homeassistant.components.template.weather.WeatherTemplate, homeassistant.components.openweathermap.weather.OpenWeatherMapWeather, homeassistant.components.nws.weather.NWSWeather, homeassistant.components.metoffice.weather.MetOfficeWeather, homeassistant.components.meteoclimatic.weather.MeteoclimaticWeather, homeassistant.components.meteo_france.weather.MeteoFranceWeather, homeassistant.components.met_eireann.weather.MetEireannWeather, homeassistant.components.met.weather.MetWeather, homeassistant.components.knx.weather.KNXWeather, homeassistant.components.kitchen_sink.weather.DemoWeather, homeassistant.components.ipma.weather.IPMAWeather, homeassistant.components.homematicip_cloud.weather.HomematicipHomeWeather, homeassistant.components.homematicip_cloud.weather.HomematicipWeatherSensor, homeassistant.components.hko.weather.HKOEntity, homeassistant.components.environment_canada.weather.ECWeather, homeassistant.components.ecobee.weather.EcobeeWeather, homeassistant.components.demo.weather.DemoWeather, homeassistant.components.aemet.weather.AemetWeather, and homeassistant.components.accuweather.weather.AccuWeatherEntity.

Definition at line 401 of file __init__.py.

◆ native_apparent_temperature()

◆ native_dew_point()

◆ native_precipitation_unit()

str | None homeassistant.components.weather.WeatherEntity.native_precipitation_unit (   self)
Return the native unit of measurement for accumulated precipitation.

Definition at line 511 of file __init__.py.

◆ native_pressure()

◆ native_pressure_unit()

str | None homeassistant.components.weather.WeatherEntity.native_pressure_unit (   self)
Return the native unit of measurement for pressure.

Reimplemented in homeassistant.components.kitchen_sink.weather.DemoWeather, and homeassistant.components.demo.weather.DemoWeather.

Definition at line 371 of file __init__.py.

◆ native_temperature()

float | None homeassistant.components.weather.WeatherEntity.native_temperature (   self)
Return the temperature in native units.

Reimplemented in homeassistant.components.zamg.weather.ZamgWeather, homeassistant.components.weatherkit.weather.WeatherKitWeather, homeassistant.components.weatherflow_cloud.weather.WeatherFlowWeather, homeassistant.components.tomorrowio.weather.TomorrowioWeatherEntity, homeassistant.components.template.weather.TriggerWeatherEntity, homeassistant.components.template.weather.WeatherTemplate, homeassistant.components.openweathermap.weather.OpenWeatherMapWeather, homeassistant.components.open_meteo.weather.OpenMeteoWeatherEntity, homeassistant.components.nws.weather.NWSWeather, homeassistant.components.metoffice.weather.MetOfficeWeather, homeassistant.components.meteoclimatic.weather.MeteoclimaticWeather, homeassistant.components.meteo_france.weather.MeteoFranceWeather, homeassistant.components.met_eireann.weather.MetEireannWeather, homeassistant.components.met.weather.MetWeather, homeassistant.components.knx.weather.KNXWeather, homeassistant.components.kitchen_sink.weather.DemoWeather, homeassistant.components.ipma.weather.IPMAWeather, homeassistant.components.homematicip_cloud.weather.HomematicipHomeWeather, homeassistant.components.homematicip_cloud.weather.HomematicipWeatherSensor, homeassistant.components.hko.weather.HKOEntity, homeassistant.components.environment_canada.weather.ECWeather, homeassistant.components.ecobee.weather.EcobeeWeather, homeassistant.components.demo.weather.DemoWeather, homeassistant.components.aemet.weather.AemetWeather, and homeassistant.components.accuweather.weather.AccuWeatherEntity.

Definition at line 328 of file __init__.py.

◆ native_temperature_unit()

str | None homeassistant.components.weather.WeatherEntity.native_temperature_unit (   self)
Return the native unit of measurement for temperature.

Reimplemented in homeassistant.components.kitchen_sink.weather.DemoWeather, and homeassistant.components.demo.weather.DemoWeather.

Definition at line 333 of file __init__.py.

◆ native_visibility()

◆ native_visibility_unit()

str | None homeassistant.components.weather.WeatherEntity.native_visibility_unit (   self)
Return the native unit of measurement for visibility.

Definition at line 471 of file __init__.py.

◆ native_wind_gust_speed()

◆ native_wind_speed()

float | None homeassistant.components.weather.WeatherEntity.native_wind_speed (   self)
Return the wind speed in native units.

Reimplemented in homeassistant.components.zamg.weather.ZamgWeather, homeassistant.components.weatherkit.weather.WeatherKitWeather, homeassistant.components.weatherflow_cloud.weather.WeatherFlowWeather, homeassistant.components.tomorrowio.weather.TomorrowioWeatherEntity, homeassistant.components.template.weather.TriggerWeatherEntity, homeassistant.components.template.weather.WeatherTemplate, homeassistant.components.openweathermap.weather.OpenWeatherMapWeather, homeassistant.components.open_meteo.weather.OpenMeteoWeatherEntity, homeassistant.components.nws.weather.NWSWeather, homeassistant.components.metoffice.weather.MetOfficeWeather, homeassistant.components.meteoclimatic.weather.MeteoclimaticWeather, homeassistant.components.meteo_france.weather.MeteoFranceWeather, homeassistant.components.met_eireann.weather.MetEireannWeather, homeassistant.components.met.weather.MetWeather, homeassistant.components.knx.weather.KNXWeather, homeassistant.components.kitchen_sink.weather.DemoWeather, homeassistant.components.ipma.weather.IPMAWeather, homeassistant.components.homematicip_cloud.weather.HomematicipHomeWeather, homeassistant.components.homematicip_cloud.weather.HomematicipWeatherSensor, homeassistant.components.environment_canada.weather.ECWeather, homeassistant.components.ecobee.weather.EcobeeWeather, homeassistant.components.demo.weather.DemoWeather, homeassistant.components.aemet.weather.AemetWeather, and homeassistant.components.accuweather.weather.AccuWeatherEntity.

Definition at line 411 of file __init__.py.

◆ native_wind_speed_unit()

str | None homeassistant.components.weather.WeatherEntity.native_wind_speed_unit (   self)
Return the native unit of measurement for wind speed.

Reimplemented in homeassistant.components.kitchen_sink.weather.DemoWeather, and homeassistant.components.demo.weather.DemoWeather.

Definition at line 416 of file __init__.py.

◆ ozone()

float | None homeassistant.components.weather.WeatherEntity.ozone (   self)

◆ precision()

float homeassistant.components.weather.WeatherEntity.precision (   self)
Return the precision of the temperature value, after unit conversion.

Definition at line 539 of file __init__.py.

◆ state()

str | None homeassistant.components.weather.WeatherEntity.state (   self)
Return the current state.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 870 of file __init__.py.

◆ state_attributes()

dict[str, Any] homeassistant.components.weather.WeatherEntity.state_attributes (   self)
Return the state attributes, converted.

Attributes are configured from native units to user-configured units.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 551 of file __init__.py.

◆ uv_index()

◆ wind_bearing()

float | str | None homeassistant.components.weather.WeatherEntity.wind_bearing (   self)

Member Data Documentation

◆ _forecast_listeners

homeassistant.components.weather.WeatherEntity._forecast_listeners
private

Definition at line 313 of file __init__.py.

◆ _temperature_unit

homeassistant.components.weather.WeatherEntity._temperature_unit
private

Definition at line 545 of file __init__.py.

◆ _weather_option_precipitation_unit

homeassistant.components.weather.WeatherEntity._weather_option_precipitation_unit
private

Definition at line 885 of file __init__.py.

◆ _weather_option_pressure_unit

homeassistant.components.weather.WeatherEntity._weather_option_pressure_unit
private

Definition at line 884 of file __init__.py.

◆ _weather_option_temperature_unit

homeassistant.components.weather.WeatherEntity._weather_option_temperature_unit
private

Definition at line 883 of file __init__.py.

◆ _weather_option_visibility_unit

homeassistant.components.weather.WeatherEntity._weather_option_visibility_unit
private

Definition at line 887 of file __init__.py.

◆ _weather_option_wind_speed_unit

homeassistant.components.weather.WeatherEntity._weather_option_wind_speed_unit
private

Definition at line 886 of file __init__.py.

◆ None

homeassistant.components.weather.WeatherEntity.None
static
ABC for weather data.

Definition at line 278 of file __init__.py.


The documentation for this class was generated from the following file: