Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.selector Namespace Reference

Classes

class  ActionSelector
 
class  ActionSelectorConfig
 
class  AddonSelector
 
class  AddonSelectorConfig
 
class  AreaSelector
 
class  AreaSelectorConfig
 
class  AssistPipelineSelector
 
class  AssistPipelineSelectorConfig
 
class  AttributeSelector
 
class  AttributeSelectorConfig
 
class  BackupLocationSelector
 
class  BackupLocationSelectorConfig
 
class  BooleanSelector
 
class  BooleanSelectorConfig
 
class  ColorRGBSelector
 
class  ColorRGBSelectorConfig
 
class  ColorTempSelector
 
class  ColorTempSelectorConfig
 
class  ColorTempSelectorUnit
 
class  ConditionSelector
 
class  ConditionSelectorConfig
 
class  ConfigEntrySelector
 
class  ConfigEntrySelectorConfig
 
class  ConstantSelector
 
class  ConstantSelectorConfig
 
class  ConversationAgentSelector
 
class  ConversationAgentSelectorConfig
 
class  CountrySelector
 
class  CountrySelectorConfig
 
class  DateSelector
 
class  DateSelectorConfig
 
class  DateTimeSelector
 
class  DateTimeSelectorConfig
 
class  DeviceFilterSelectorConfig
 
class  DeviceSelector
 
class  DeviceSelectorConfig
 
class  DurationSelector
 
class  DurationSelectorConfig
 
class  EntityFilterSelectorConfig
 
class  EntitySelector
 
class  EntitySelectorConfig
 
class  FileSelector
 
class  FileSelectorConfig
 
class  FloorSelector
 
class  FloorSelectorConfig
 
class  IconSelector
 
class  IconSelectorConfig
 
class  LabelSelector
 
class  LabelSelectorConfig
 
class  LanguageSelector
 
class  LanguageSelectorConfig
 
class  LocationSelector
 
class  LocationSelectorConfig
 
class  MediaSelector
 
class  MediaSelectorConfig
 
class  NumberSelector
 
class  NumberSelectorConfig
 
class  NumberSelectorMode
 
class  ObjectSelector
 
class  ObjectSelectorConfig
 
class  QrCodeSelector
 
class  QrCodeSelectorConfig
 
class  QrErrorCorrectionLevel
 
class  SelectOptionDict
 
class  Selector
 
class  SelectSelector
 
class  SelectSelectorConfig
 
class  SelectSelectorMode
 
class  StateSelector
 
class  StateSelectorConfig
 
class  TargetSelector
 
class  TargetSelectorConfig
 
class  TemplateSelector
 
class  TemplateSelectorConfig
 
class  TextSelector
 
class  TextSelectorConfig
 
class  TextSelectorType
 
class  ThemeSelector
 
class  ThemeSelectorConfig
 
class  TimeSelector
 
class  TimeSelectorConfig
 
class  TriggerSelector
 
class  TriggerSelectorConfig
 

Functions

bool __eq__ (self, object other)
 
None __init__ (self, Mapping[str, Any]|None config=None)
 
int _entity_feature_flag (str domain, str enum_name, str feature_name)
 
type[Selector_get_selector_class (Any config)
 
int _validate_supported_feature (str supported_feature)
 
int _validate_supported_features (int|list[str] supported_features)
 
Selector selector (Any config)
 
dict[str, dict[str, _T]] serialize (self)
 
dict validate_selector (Any config)
 
Any validate_slider (Any data)
 

Variables

 config
 
 DEVICE_FILTER_SELECTOR_CONFIG_SCHEMA
 
 ENTITY_FILTER_SELECTOR_CONFIG_SCHEMA
 
 select_option
 
 selector_type
 

Detailed Description

Selectors for Home Assistant.

Function Documentation

◆ __eq__()

bool homeassistant.helpers.selector.__eq__ (   self,
object  other 
)
Check equality.

Definition at line 78 of file selector.py.

◆ __init__()

None homeassistant.helpers.selector.__init__ (   self,
Mapping[str, Any] | None   config = None 
)
Base class for selectors.
Instantiate a selector.

Definition at line 70 of file selector.py.

◆ _entity_feature_flag()

int homeassistant.helpers.selector._entity_feature_flag ( str  domain,
str  enum_name,
str  feature_name 
)
private
Return a cached lookup of an entity feature enum.

This will import a module from disk and is run from an executor when
loading the services schema files.

Definition at line 91 of file selector.py.

◆ _get_selector_class()

type[Selector] homeassistant.helpers.selector._get_selector_class ( Any  config)
private
Get selector class type.

Definition at line 25 of file selector.py.

◆ _validate_supported_feature()

int homeassistant.helpers.selector._validate_supported_feature ( str  supported_feature)
private
Validate a supported feature and resolve an enum string to its value.

Definition at line 103 of file selector.py.

◆ _validate_supported_features()

int homeassistant.helpers.selector._validate_supported_features ( int | list[str]  supported_features)
private
Validate a supported feature and resolve an enum string to its value.

Definition at line 120 of file selector.py.

◆ selector()

Selector homeassistant.helpers.selector.selector ( Any  config)
Instantiate a selector.

Definition at line 41 of file selector.py.

◆ serialize()

dict[str, dict[str, _T]] homeassistant.helpers.selector.serialize (   self)
Serialize Selector for voluptuous_serialize.

Definition at line 85 of file selector.py.

◆ validate_selector()

dict homeassistant.helpers.selector.validate_selector ( Any  config)
Validate a selector.

Definition at line 49 of file selector.py.

◆ validate_slider()

Any homeassistant.helpers.selector.validate_slider ( Any  data)
Validate configuration.

Definition at line 1043 of file selector.py.

Variable Documentation

◆ config

homeassistant.helpers.selector.config

Definition at line 76 of file selector.py.

◆ DEVICE_FILTER_SELECTOR_CONFIG_SCHEMA

homeassistant.helpers.selector.DEVICE_FILTER_SELECTOR_CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  # Integration linked to it with a config entry
4  vol.Optional("integration"): str,
5  # Manufacturer of device
6  vol.Optional("manufacturer"): str,
7  # Model of device
8  vol.Optional("model"): str,
9  # Device has to contain entities matching this selector
10  vol.Optional("entity"): vol.All(
11  cv.ensure_list, [ENTITY_FILTER_SELECTOR_CONFIG_SCHEMA]
12  ),
13  }
14 )

Definition at line 159 of file selector.py.

◆ ENTITY_FILTER_SELECTOR_CONFIG_SCHEMA

homeassistant.helpers.selector.ENTITY_FILTER_SELECTOR_CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  # Integration that provided the entity
4  vol.Optional("integration"): str,
5  # Domain the entity belongs to
6  vol.Optional("domain"): vol.All(cv.ensure_list, [str]),
7  # Device class of the entity
8  vol.Optional("device_class"): vol.All(cv.ensure_list, [str]),
9  # Features supported by the entity
10  vol.Optional("supported_features"): [
11  vol.All(cv.ensure_list, [str], _validate_supported_features)
12  ],
13  }
14 )

Definition at line 134 of file selector.py.

◆ select_option

homeassistant.helpers.selector.select_option
Initial value:
1 = vol.All(
2  dict,
3  vol.Schema(
4  {
5  vol.Required("value"): str,
6  vol.Required("label"): str,
7  }
8  ),
9 )

Definition at line 1117 of file selector.py.

◆ selector_type

homeassistant.helpers.selector.selector_type

Definition at line 83 of file selector.py.