Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.google_assistant.trait.SensorStateTrait Class Reference
Inheritance diagram for homeassistant.components.google_assistant.trait.SensorStateTrait:
[legend]
Collaboration diagram for homeassistant.components.google_assistant.trait.SensorStateTrait:
[legend]

Public Member Functions

dict[str, Any] query_attributes (self)
 
def supported (cls, domain, features, device_class, _)
 
dict[str, Any] sync_attributes (self)
 
- Public Member Functions inherited from homeassistant.components.google_assistant.trait._Trait
None __init__ (self, HomeAssistant hass, state, config)
 
def can_execute (self, command, params)
 
def execute (self, command, data, params, challenge)
 
dict[str, Any]|None query_notifications (self)
 
dict[str, Any] sync_options (self)
 

Static Public Attributes

dictionary binary_sensor_types
 
 name = TRAIT_SENSOR_STATE
 
dictionary sensor_types
 

Private Member Functions

str _air_quality_description_for_aqi (self, float|None aqi)
 

Additional Inherited Members

- Static Public Member Functions inherited from homeassistant.components.google_assistant.trait._Trait
def might_2fa (domain, features, device_class)
 
def supported (domain, features, device_class, attributes)
 
- Public Attributes inherited from homeassistant.components.google_assistant.trait._Trait
 config
 
 hass
 
 state
 

Detailed Description

Trait to get sensor state.

https://developers.google.com/actions/smarthome/traits/sensorstate

Definition at line 2691 of file trait.py.

Member Function Documentation

◆ _air_quality_description_for_aqi()

str homeassistant.components.google_assistant.trait.SensorStateTrait._air_quality_description_for_aqi (   self,
float | None  aqi 
)
private

Definition at line 2727 of file trait.py.

◆ query_attributes()

dict[str, Any] homeassistant.components.google_assistant.trait.SensorStateTrait.query_attributes (   self)
Return the attributes of this trait for this entity.

Reimplemented from homeassistant.components.google_assistant.trait._Trait.

Definition at line 2793 of file trait.py.

◆ supported()

def homeassistant.components.google_assistant.trait.SensorStateTrait.supported (   cls,
  domain,
  features,
  device_class,
  _ 
)
Test if state is supported.

Definition at line 2744 of file trait.py.

◆ sync_attributes()

dict[str, Any] homeassistant.components.google_assistant.trait.SensorStateTrait.sync_attributes (   self)
Return attributes for a sync request.

Reimplemented from homeassistant.components.google_assistant.trait._Trait.

Definition at line 2750 of file trait.py.

Member Data Documentation

◆ binary_sensor_types

dictionary homeassistant.components.google_assistant.trait.SensorStateTrait.binary_sensor_types
static
Initial value:
= {
binary_sensor.BinarySensorDeviceClass.CO: (
"CarbonMonoxideLevel",
["carbon monoxide detected", "no carbon monoxide detected", "unknown"],
),
binary_sensor.BinarySensorDeviceClass.SMOKE: (
"SmokeLevel",
["smoke detected", "no smoke detected", "unknown"],
),
binary_sensor.BinarySensorDeviceClass.MOISTURE: (
"WaterLeak",
["leak", "no leak", "unknown"],
),
}

Definition at line 2709 of file trait.py.

◆ name

homeassistant.components.google_assistant.trait.SensorStateTrait.name = TRAIT_SENSOR_STATE
static

Definition at line 2724 of file trait.py.

◆ sensor_types

dictionary homeassistant.components.google_assistant.trait.SensorStateTrait.sensor_types
static
Initial value:
= {
sensor.SensorDeviceClass.AQI: ("AirQuality", "AQI"),
sensor.SensorDeviceClass.CO: ("CarbonMonoxideLevel", "PARTS_PER_MILLION"),
sensor.SensorDeviceClass.CO2: ("CarbonDioxideLevel", "PARTS_PER_MILLION"),
sensor.SensorDeviceClass.PM25: ("PM2.5", "MICROGRAMS_PER_CUBIC_METER"),
sensor.SensorDeviceClass.PM10: ("PM10", "MICROGRAMS_PER_CUBIC_METER"),
sensor.SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS: (
"VolatileOrganicCompounds",
"PARTS_PER_MILLION",
),
}

Definition at line 2697 of file trait.py.


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