Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.counter Namespace Reference

Namespaces

 reproduce_state
 

Classes

class  Counter
 
class  CounterStorageCollection
 

Functions

_T|dict[str, Any] _T (_T|None value)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_INITIAL = "initial"
 
string ATTR_MAXIMUM = "maximum"
 
string ATTR_MINIMUM = "minimum"
 
string ATTR_STEP = "step"
 
string CONF_INITIAL = "initial"
 
 CONF_MAXIMUM
 
 CONF_MINIMUM
 
string CONF_RESTORE = "restore"
 
string CONF_STEP = "step"
 
 CONFIG_SCHEMA
 
 default
 
int DEFAULT_INITIAL = 0
 
int DEFAULT_STEP = 1
 
string DOMAIN = "counter"
 
string ENTITY_ID_FORMAT = DOMAIN + ".{}"
 
string SERVICE_DECREMENT = "decrement"
 
string SERVICE_INCREMENT = "increment"
 
string SERVICE_RESET = "reset"
 
string SERVICE_SET_VALUE = "set_value"
 
string STORAGE_KEY = DOMAIN
 
int STORAGE_VERSION = 1
 
string VALUE = "value"
 
 VolDictType
 

Detailed Description

Component to count within automations.

Function Documentation

◆ _T()

_T | dict[str, Any] homeassistant.components.counter._T ( _T | None  value)
private

Definition at line 63 of file __init__.py.

◆ async_setup()

bool homeassistant.components.counter.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up the counters.

Definition at line 96 of file __init__.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.counter._LOGGER = logging.getLogger(__name__)
private

Definition at line 26 of file __init__.py.

◆ ATTR_INITIAL

string homeassistant.components.counter.ATTR_INITIAL = "initial"

Definition at line 28 of file __init__.py.

◆ ATTR_MAXIMUM

string homeassistant.components.counter.ATTR_MAXIMUM = "maximum"

Definition at line 31 of file __init__.py.

◆ ATTR_MINIMUM

string homeassistant.components.counter.ATTR_MINIMUM = "minimum"

Definition at line 30 of file __init__.py.

◆ ATTR_STEP

string homeassistant.components.counter.ATTR_STEP = "step"

Definition at line 29 of file __init__.py.

◆ CONF_INITIAL

homeassistant.components.counter.CONF_INITIAL = "initial"

Definition at line 34 of file __init__.py.

◆ CONF_MAXIMUM

homeassistant.components.counter.CONF_MAXIMUM

Definition at line 56 of file __init__.py.

◆ CONF_MINIMUM

homeassistant.components.counter.CONF_MINIMUM

Definition at line 57 of file __init__.py.

◆ CONF_RESTORE

homeassistant.components.counter.CONF_RESTORE = "restore"

Definition at line 35 of file __init__.py.

◆ CONF_STEP

homeassistant.components.counter.CONF_STEP = "step"

Definition at line 36 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.counter.CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  DOMAIN: cv.schema_with_slug_keys(
4  vol.All(
5  _none_to_empty_dict,
6  {
7  vol.Optional(CONF_ICON): cv.icon,
8  vol.Optional(
9  CONF_INITIAL, default=DEFAULT_INITIAL
10  ): cv.positive_int,
11  vol.Optional(CONF_NAME): cv.string,
12  vol.Optional(CONF_MAXIMUM, default=None): vol.Any(
13  None, vol.Coerce(int)
14  ),
15  vol.Optional(CONF_MINIMUM, default=None): vol.Any(
16  None, vol.Coerce(int)
17  ),
18  vol.Optional(CONF_RESTORE, default=True): cv.boolean,
19  vol.Optional(CONF_STEP, default=DEFAULT_STEP): cv.positive_int,
20  },
21  )
22  )
23  },
24  extra=vol.ALLOW_EXTRA,
25 )

Definition at line 69 of file __init__.py.

◆ default

homeassistant.components.counter.default

Definition at line 54 of file __init__.py.

◆ DEFAULT_INITIAL

int homeassistant.components.counter.DEFAULT_INITIAL = 0

Definition at line 38 of file __init__.py.

◆ DEFAULT_STEP

int homeassistant.components.counter.DEFAULT_STEP = 1

Definition at line 39 of file __init__.py.

◆ DOMAIN

string homeassistant.components.counter.DOMAIN = "counter"

Definition at line 40 of file __init__.py.

◆ ENTITY_ID_FORMAT

string homeassistant.components.counter.ENTITY_ID_FORMAT = DOMAIN + ".{}"

Definition at line 42 of file __init__.py.

◆ SERVICE_DECREMENT

string homeassistant.components.counter.SERVICE_DECREMENT = "decrement"

Definition at line 44 of file __init__.py.

◆ SERVICE_INCREMENT

string homeassistant.components.counter.SERVICE_INCREMENT = "increment"

Definition at line 45 of file __init__.py.

◆ SERVICE_RESET

string homeassistant.components.counter.SERVICE_RESET = "reset"

Definition at line 46 of file __init__.py.

◆ SERVICE_SET_VALUE

string homeassistant.components.counter.SERVICE_SET_VALUE = "set_value"

Definition at line 47 of file __init__.py.

◆ STORAGE_KEY

string homeassistant.components.counter.STORAGE_KEY = DOMAIN

Definition at line 49 of file __init__.py.

◆ STORAGE_VERSION

int homeassistant.components.counter.STORAGE_VERSION = 1

Definition at line 50 of file __init__.py.

◆ VALUE

string homeassistant.components.counter.VALUE = "value"

Definition at line 32 of file __init__.py.

◆ VolDictType

homeassistant.components.counter.VolDictType

Definition at line 52 of file __init__.py.