Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.template.number Namespace Reference

Classes

class  TemplateNumber
 
class  TriggerNumberEntity
 

Functions

list[TemplateNumber_async_create_entities (HomeAssistant hass, list[dict[str, Any]] definitions, str|None unique_id_prefix)
 
TemplateNumber async_create_preview_number (HomeAssistant hass, str name, dict[str, Any] config)
 
None async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
None async_setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string CONF_SET_VALUE = "set_value"
 
string DEFAULT_NAME = "Template Number"
 
bool DEFAULT_OPTIMISTIC = False
 
 NUMBER_CONFIG_SCHEMA
 
tuple NUMBER_SCHEMA
 

Detailed Description

Support for numbers which integrates with other components.

Function Documentation

◆ _async_create_entities()

list[TemplateNumber] homeassistant.components.template.number._async_create_entities ( HomeAssistant  hass,
list[dict[str, Any]]  definitions,
str | None   unique_id_prefix 
)
private
Create the Template number.

Definition at line 81 of file number.py.

◆ async_create_preview_number()

TemplateNumber homeassistant.components.template.number.async_create_preview_number ( HomeAssistant  hass,
str  name,
dict[str, Any]   config 
)
Create a preview number.

Definition at line 134 of file number.py.

◆ async_setup_entry()

None homeassistant.components.template.number.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Initialize config entry.

Definition at line 121 of file number.py.

◆ async_setup_platform()

None homeassistant.components.template.number.async_setup_platform ( HomeAssistant  hass,
ConfigType  config,
AddEntitiesCallback  async_add_entities,
DiscoveryInfoType | None   discovery_info = None 
)
Set up the template number.

Definition at line 94 of file number.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.template.number._LOGGER = logging.getLogger(__name__)
private

Definition at line 43 of file number.py.

◆ CONF_SET_VALUE

string homeassistant.components.template.number.CONF_SET_VALUE = "set_value"

Definition at line 45 of file number.py.

◆ DEFAULT_NAME

string homeassistant.components.template.number.DEFAULT_NAME = "Template Number"

Definition at line 47 of file number.py.

◆ DEFAULT_OPTIMISTIC

bool homeassistant.components.template.number.DEFAULT_OPTIMISTIC = False

Definition at line 48 of file number.py.

◆ NUMBER_CONFIG_SCHEMA

homeassistant.components.template.number.NUMBER_CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_NAME): cv.template,
4  vol.Required(CONF_STATE): cv.template,
5  vol.Required(CONF_STEP): cv.template,
6  vol.Required(CONF_SET_VALUE): cv.SCRIPT_SCHEMA,
7  vol.Optional(CONF_MIN): cv.template,
8  vol.Optional(CONF_MAX): cv.template,
9  vol.Optional(CONF_UNIT_OF_MEASUREMENT): cv.string,
10  vol.Optional(CONF_DEVICE_ID): selector.DeviceSelector(),
11  }
12 )

Definition at line 67 of file number.py.

◆ NUMBER_SCHEMA

tuple homeassistant.components.template.number.NUMBER_SCHEMA
Initial value:
1 = (
2  vol.Schema(
3  {
4  vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.template,
5  vol.Required(CONF_STATE): cv.template,
6  vol.Required(CONF_SET_VALUE): cv.SCRIPT_SCHEMA,
7  vol.Required(CONF_STEP): cv.template,
8  vol.Optional(CONF_MIN, default=DEFAULT_MIN_VALUE): cv.template,
9  vol.Optional(CONF_MAX, default=DEFAULT_MAX_VALUE): cv.template,
10  vol.Optional(CONF_UNIT_OF_MEASUREMENT): cv.string,
11  vol.Optional(CONF_OPTIMISTIC, default=DEFAULT_OPTIMISTIC): cv.boolean,
12  vol.Optional(CONF_UNIQUE_ID): cv.string,
13  }
14  )
15  .extend(TEMPLATE_ENTITY_AVAILABILITY_SCHEMA.schema)
16  .extend(TEMPLATE_ENTITY_ICON_SCHEMA.schema)
17 )

Definition at line 50 of file number.py.