Types Reference

This page contains auto-generated documentation for common types used throughout Domovoy.

Home Assistant Types

Types for interacting with Home Assistant entities and values.

Entity ID Types

Typed entity ID classes for different Home Assistant domains.

class domovoy.plugins.hass.entity_id.EntityID(entity_id)[source]

Bases: Generic

Parameters:

entity_id (str | EntityID)

get_domain()[source]
Return type:

str

get_entity_name()[source]
Return type:

str

parse_state(state)[source]
Return type:

int | float | str | bool | datetime | EntityID

Parameters:

state (int | float | str | bool | datetime | EntityID)

parse_state_typed(full_state)[source]
Return type:

TypeVar(T) | None

Parameters:

full_state (EntityState)

get_target_type()[source]
Return type:

type[TypeVar(T)]

Application Types

Types used in app configuration and scheduling.

class domovoy.applications.types.Interval(days=0, hours=0, minutes=0, seconds=0, milliseconds=0)[source]

Bases: object

Parameters:
days: int = 0
hours: int = 0
minutes: int = 0
seconds: int = 0
milliseconds: float = 0
is_valid()[source]

Check if an interval has a non-zero duration.

Return type:

bool

Returns:

bool: True if at least one of the fields of the interval is non-zero.

to_timedelta()[source]

Convert the interval to a datetime.timedelta.

Return type:

timedelta

Returns:

datetime.timedelta: The equivalent datetime.timedelta for the interval.

total_seconds()[source]

Get the total duration of the interval in fractional seconds.

Return type:

float

Returns:

float: The total duration of the interval.

ServEnts Entity Types

Entity wrapper types returned by ServEnts plugin.

class domovoy.plugins.servents.entities.ServEntEntity(hass, entity_type, servent_id, config, device_config, entity_id_type)[source]

Bases: Generic

Parameters:
  • hass (HassPlugin)

  • entity_type (EntityType)

  • servent_id (str)

  • config (EntityConfig)

  • device_config (DeviceConfig)

  • entity_id_type (type[T])

async set_to(state, attributes=None)[source]
Return type:

None

Parameters:
get_entity_id()[source]
Return type:

TypeVar(T, bound= EntityID)

get_state()[source]
Return type:

int | float | str | bool | datetime | EntityID

get_raw_state()[source]
Return type:

int | float | str | bool | datetime | EntityID

get_state_attributes()[source]
Return type:

dict[str, int | float | str | bool | datetime | EntityID | list[int | float | str | bool | datetime | EntityID | dict[str, int | float | str | bool | datetime | EntityID | None]] | dict[str, int | float | str | bool | datetime | EntityID | list[int | float | str | bool | datetime | EntityID] | None] | None]

get_full_state()[source]
Return type:

EntityState

class domovoy.plugins.servents.entities.ServEntSensor(hass, servent_id, config, device_config)[source]

Bases: ServEntEntity[SensorEntity]

Parameters:
  • hass (HassPlugin)

  • servent_id (str)

  • config (SensorConfig)

  • device_config (DeviceConfig)

async set_to(state, attributes=None)[source]
Return type:

None

Parameters:
get_state()[source]
Return type:

float | int | str | datetime

class domovoy.plugins.servents.entities.ServEntThresholdBinarySensor(hass, servent_id, config, device_config)[source]

Bases: ServEntEntity[BinarySensorEntity]

Parameters:
  • hass (HassPlugin)

  • servent_id (str)

  • config (ThresholdBinarySensorConfig)

  • device_config (DeviceConfig)

async set_to(_state, _attributes=None)[source]
Return type:

None

Parameters:
  • _state (bool)

  • _attributes (dict | None)

get_state()[source]
Return type:

bool | None

class domovoy.plugins.servents.entities.ServEntBinarySensor(hass, servent_id, config, device_config)[source]

Bases: ServEntEntity[BinarySensorEntity]

Parameters:
  • hass (HassPlugin)

  • servent_id (str)

  • config (BinarySensorConfig)

  • device_config (DeviceConfig)

async set_on(attributes=None)[source]
Return type:

None

Parameters:

attributes (dict | None)

async set_off(attributes=None)[source]
Return type:

None

Parameters:

attributes (dict | None)

async set_to(state, attributes=None)[source]
Return type:

None

Parameters:
async get_state()[source]
Return type:

bool | None

class domovoy.plugins.servents.entities.ServEntSwitch(hass, servent_id, config, device_config)[source]

Bases: ServEntEntity[SwitchEntity]

Parameters:
  • hass (HassPlugin)

  • servent_id (str)

  • config (SwitchConfig)

  • device_config (DeviceConfig)

async set_on(attributes=None)[source]
Return type:

None

Parameters:

attributes (dict | None)

async set_off(attributes=None)[source]
Return type:

None

Parameters:

attributes (dict | None)

async set_to(state, attributes=None)[source]
Return type:

None

Parameters:
get_state()[source]
Return type:

bool | None

is_on()[source]
Return type:

bool

is_off()[source]
Return type:

bool

class domovoy.plugins.servents.entities.ServEntNumber(hass, servent_id, config, device_config)[source]

Bases: ServEntEntity[NumberEntity]

Parameters:
  • hass (HassPlugin)

  • servent_id (str)

  • config (NumberConfig)

  • device_config (DeviceConfig)

async set_to(state, attributes=None)[source]
Return type:

None

Parameters:
get_state()[source]
Return type:

float | int | None

class domovoy.plugins.servents.entities.ServEntSelect(hass, servent_id, config, device_config)[source]

Bases: ServEntEntity[SelectEntity]

Parameters:
  • hass (HassPlugin)

  • servent_id (str)

  • config (SelectConfig)

  • device_config (DeviceConfig)

async set_to(state, attributes=None)[source]
Return type:

None

Parameters:
class domovoy.plugins.servents.entities.ServEntButton(hass, servent_id, config, device_config)[source]

Bases: ServEntEntity[ButtonEntity]

Parameters:
  • hass (HassPlugin)

  • servent_id (str)

  • config (ButtonConfig)

  • device_config (DeviceConfig)