Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.recorder.models.time Namespace Reference

Functions

float|None datetime_to_timestamp_or_none (datetime|None dt)
 
datetime process_timestamp (datetime ts)
 
datetime|None process_timestamp (datetime|None ts)
 
None process_timestamp (None ts)
 
str process_timestamp_to_utc_isoformat (datetime ts)
 
str|None process_timestamp_to_utc_isoformat (datetime|None ts)
 
None process_timestamp_to_utc_isoformat (None ts)
 
datetime|None timestamp_to_datetime_or_none (float|None ts)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string DB_TIMEZONE = "+00:00"
 
string EMPTY_JSON_OBJECT = "{}"
 

Detailed Description

Models for Recorder.

Function Documentation

◆ datetime_to_timestamp_or_none()

float | None homeassistant.components.recorder.models.time.datetime_to_timestamp_or_none ( datetime | None  dt)
Convert a datetime to a timestamp.

Definition at line 55 of file time.py.

◆ process_timestamp() [1/3]

datetime homeassistant.components.recorder.models.time.process_timestamp ( datetime  ts)

Definition at line 23 of file time.py.

◆ process_timestamp() [2/3]

datetime | None homeassistant.components.recorder.models.time.process_timestamp ( datetime | None  ts)
Process a timestamp into datetime object.

Definition at line 26 of file time.py.

◆ process_timestamp() [3/3]

None homeassistant.components.recorder.models.time.process_timestamp ( None  ts)

Definition at line 19 of file time.py.

◆ process_timestamp_to_utc_isoformat() [1/3]

str homeassistant.components.recorder.models.time.process_timestamp_to_utc_isoformat ( datetime  ts)

Definition at line 41 of file time.py.

◆ process_timestamp_to_utc_isoformat() [2/3]

str | None homeassistant.components.recorder.models.time.process_timestamp_to_utc_isoformat ( datetime | None  ts)
Process a timestamp into UTC isotime.

Definition at line 44 of file time.py.

◆ process_timestamp_to_utc_isoformat() [3/3]

None homeassistant.components.recorder.models.time.process_timestamp_to_utc_isoformat ( None  ts)

Definition at line 37 of file time.py.

◆ timestamp_to_datetime_or_none()

datetime | None homeassistant.components.recorder.models.time.timestamp_to_datetime_or_none ( float | None  ts)
Convert a timestamp to a datetime.

Definition at line 60 of file time.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.recorder.models.time._LOGGER = logging.getLogger(__name__)
private

Definition at line 11 of file time.py.

◆ DB_TIMEZONE

string homeassistant.components.recorder.models.time.DB_TIMEZONE = "+00:00"

Definition at line 13 of file time.py.

◆ EMPTY_JSON_OBJECT

string homeassistant.components.recorder.models.time.EMPTY_JSON_OBJECT = "{}"

Definition at line 15 of file time.py.