Enasis Network Homie Automate#

Documentation Welcome#

Welcome to the project documentation. Below you will find the most common functions and classes within the library, but you may click your way further into the project from there. You can also view the source code.

Homie#

class enhomie.homie.Homie(config: HomieConfig)[source]#

Bases: object

Interact with supported devices to ensure desired state.

Parameters:

config – Primary class instance for configuration.

property config: HomieConfig#

Return the Config instance containing the configuration.

Returns:

Config instance containing the configuration.

property logger: HomieLogger#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property jinja2: HomieJinja2#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property childs: HomieChilds#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property persist: HomiePersist#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property console: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property debug: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property dryrun: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property forced: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property desired: HomieDesired#

Return the related actions matching the provided event.

Returns:

Related actions matching the provided event.

property aspired: HomieAspired#

Return the related desired state for the desired groups.

Returns:

Related desired state for the desired groups.

refresh(timeout: int | None = None) bool[source]#

Refresh the cached information for the remote upstream.

Parameters:

timeout – Timeout waiting for the server response.

Returns:

Boolean indicating the success of the refresh.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

printer(source: HomiePrint, color: int = 6) None[source]#

Print the contents for the object within Homie instance.

Parameters:
  • source – Content which will be shown after header.

  • color – Override the color used for box character.

get_actions(target: HomieActionNode, *, state: HomieState | None = None, color: str | None = None, level: int | None = None, scene: HomieScene | None = None, force: bool = False, change: bool = True) HomieActionBase[source]#

Insert the new item containing information for operation.

Parameters:
  • target – Device or group settings will be updated.

  • state – Determine the state related to the target.

  • color – Determine the color related to the target.

  • level – Determine the level related to the target.

  • scene – Determine the scene related to the target.

  • force – Override the default for full idempotency.

  • change – Determine whether the change is executed.

set_actions(aitems: HomieActionBase, force: bool = False, change: bool = True) bool[source]#

Insert the new item containing information for operation.

Parameters:
  • aitems – Constructed action objects for operation.

  • force – Override the default for full idempotency.

  • change – Determine whether the change is executed.

Returns:

Boolean indicating whether or not was changed.

j2parse(value: Any, statics: dict[str, Any] | None = None, literal: bool = True) Any[source]#

Return the provided input using the Jinja2 environment.

Parameters:
  • value – Input that will be processed and returned.

  • statics – Additional values available for parsing.

  • literal – Determine if Python objects are evaled.

Returns:

Provided input using the Jinja2 environment.

class enhomie.homie.HomieConfig(sargs: dict[str, Any] | None = None, files: str | Path | list[str | Path] | list[str] | list[Path] | tuple[str | Path, ...] | set[str] | None = None, cargs: dict[str, Any] | None = None)[source]#

Bases: Config

Contain the configurations from the arguments and files.

Parameters:
  • sargs – Additional arguments on the command line.

  • files – Complete or relative path to config files.

  • cargs – Configuration arguments in dictionary form, which will override contents from the config files.

property params: HomieParams#

Return the Pydantic model containing the configuration.

Warning

This method completely overrides the parent but is based on that code, would be unfortunate if upstream changes meant this breaks or breaks something else.

Returns:

Pydantic model containing the configuration.

merge_params() None[source]#

Update the Pydantic model containing the configuration.

class enhomie.homie.HomieService(homie: Homie)[source]#

Bases: object

Multi-threaded service for processing the desired state.

Parameters:

homie – Primary class instance for Homie Automate.

property homie: Homie#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property params: HomieServiceParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property actions: HomieActions | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property updates: HomieUpdates | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property streams: HomieStreams | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property restful: HomieRestful | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property running: list[str]#

Return the list of threads which are determined running.

Returns:

List of threads which are determined running.

property zombies: list[str]#

Return the list of threads which are determined zombies.

Returns:

List of threads which are determined zombies.

property congest: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

property enqueue: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

start() None[source]#

Start the various threads within the Homie class object.

operate() None[source]#

Perform the operation related to Homie service members.

operate_updates() None[source]#

Perform the operation related to Homie service members.

operate_streams() None[source]#

Perform the operation related to Homie service members.

operate_healths() None[source]#

Perform the operation related to Homie service members.

check_zombies() bool[source]#

Return the boolean indicating while threads are zombies.

Returns:

Boolean indicating while threads are zombies.

check_congest() bool[source]#

Return the boolean indicating when queues are congested.

Returns:

Boolean indicating when queues are congested.

soft(*args: Any, **kwargs: Any) None[source]#

Stop the various threads within the Homie class object.

Parameters:
  • kwargs – Keyword arguments ignored by the method.

  • args – Positional arguments ignored by the method.

stop(*args: Any, **kwargs: Any) None[source]#

Stop the various threads within the Homie class object.

Parameters:
  • kwargs – Keyword arguments ignored by the method.

  • args – Positional arguments ignored by the method.

Homie Parameters#

class enhomie.homie.params.HomieParams[source]#

Bases: Params

Process and validate the core configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

aspires

dict[str, HomieAspireParams] | None

No

None

min_length=1

console

bool

No

False

database

str

No

'sqlite:///:memory:'

min_length=1

debug

bool

No

False

desires

dict[str, HomieDesireParams] | None

No

None

min_length=1

devices

dict[str, HomieDeviceParams] | None

No

None

min_length=1

dryrun

bool

No

False

enconfig

ConfigParams | None

No

None

encrypts

CryptsParams | None

No

None

enlogger

LoggerParams | None

No

None

filters

HomieFiltersParams

No

factory

forced

bool

No

True

groups

dict[str, HomieGroupParams] | None

No

None

min_length=1

origins

dict[str, HomieOriginParams] | None

No

None

min_length=1

persists

dict[str, HomiePersistParams] | None

No

None

min_length=1

printer

HomiePrinterParams

No

factory

restful

RestfulServiceParams

No

factory

scenes

dict[str, HomieSceneParams] | None

No

None

min_length=1

service

HomieServiceParams

No

factory

database: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='sqlite:///:memory:', description='Database connection string', metadata=[MinLen(min_length=1)])]#
console: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Output console information; parameter is parsed by and used in low-level config')]#
debug: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Enable logging level debug; parameter is parsed by and used in low-level config')]#
dryrun: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Whether to allow changes')]#
forced: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Ignore present idempotency')]#
printer: Annotated[HomiePrinterParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomiePrinterParams, description='Print the stream to console')]#
service: Annotated[HomieServiceParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomieServiceParams, description='Parameters for Homie Service')]#
restful: Annotated[RestfulServiceParams, FieldInfo(annotation=NoneType, required=False, default_factory=RestfulServiceParams, description='Parameters for Homie RESTful')]#
persists: Annotated[dict[str, HomiePersistParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameters for common persists', metadata=[MinLen(min_length=1)])]#
filters: Annotated[HomieFiltersParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomieFiltersParams, description='Determine object instantiation')]#
origins: Annotated[dict[str, HomieOriginParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameters for Homie origins', metadata=[MinLen(min_length=1)])]#
devices: Annotated[dict[str, HomieDeviceParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameters for Homie devices', metadata=[MinLen(min_length=1)])]#
groups: Annotated[dict[str, HomieGroupParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameters for Homie groups', metadata=[MinLen(min_length=1)])]#
scenes: Annotated[dict[str, HomieSceneParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameters for Homie scenes', metadata=[MinLen(min_length=1)])]#
desires: Annotated[dict[str, HomieDesireParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameters for Homie desires', metadata=[MinLen(min_length=1)])]#
aspires: Annotated[dict[str, HomieAspireParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameters for Homie aspires', metadata=[MinLen(min_length=1)])]#
class enhomie.homie.params.HomiePrinterParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

action

bool

No

False

aspire

bool

No

False

desire

bool

No

False

stream

bool

No

False

update

bool

No

False

action: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Print the actions to console')]#
update: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Print the updates to console')]#
stream: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Print the streams to console')]#
desire: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Print the aspires to console')]#
aspire: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Print the aspires to console')]#
class enhomie.homie.params.HomiePersistParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

about

str | None

No

None

min_length=1

about_icon

str | None

No

None

min_length=1

about_label

str | None

No

None

min_length=1

expire

str | None

No

None

min_length=1, pattern=``re.compile(‘^(\d+(s|m|h|d|w|y))*$’)``

level

Literal[‘failure’, ‘information’, ‘success’, ‘warning’] | None

No

None

min_length=1

tags

list[str] | None

No

None

min_length=1

value_icon

str | None

No

None

min_length=1

value_label

str | None

No

None

min_length=1

value_unit

str | None

No

None

min_length=1

value_unit: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Unit for persist value', metadata=[MinLen(min_length=1)])]#
value_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist value', metadata=[MinLen(min_length=1)])]#
value_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist value', metadata=[MinLen(min_length=1)])]#
about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='About the persist entry', metadata=[MinLen(min_length=1)])]#
about_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist entry', metadata=[MinLen(min_length=1)])]#
about_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist entry', metadata=[MinLen(min_length=1)])]#
level: Annotated[Literal['failure', 'information', 'success', 'warning'] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Severity of persist entry', metadata=[MinLen(min_length=1)])]#
tags: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Tags for persist entry', metadata=[MinLen(min_length=1)])]#
expire: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='After when the key expires', examples=['1h', '1h30m', '1d'], metadata=[MinLen(min_length=1), _PydanticGeneralMetadata(pattern=re.compile('^(\\d+(s|m|h|d|w|y))*$'))])]#
class enhomie.homie.params.HomieOriginParams[source]#

Bases: HomieChildParams

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

hubitat

HubiOriginParams | None

No

None

philips

PhueOriginParams | None

No

None

ubiquiti

UbiqOriginParams | None

No

None

hubitat: Annotated[HubiOriginParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Connection specific parameters')]#
philips: Annotated[PhueOriginParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Connection specific parameters')]#
ubiquiti: Annotated[UbiqOriginParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Connection specific parameters')]#
class enhomie.homie.params.HomieDeviceParams[source]#

Bases: HomieChildParams

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

label

str | None

No

None

min_length=1

origin

str

Yes

min_length=1

unique

str | None

No

None

min_length=1

origin: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Origin where device exists', metadata=[MinLen(min_length=1)])]#
label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Device name in the origin', metadata=[MinLen(min_length=1)])]#
unique: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Unique identifier in origin', metadata=[MinLen(min_length=1)])]#
class enhomie.homie.params.HomieGroupParams[source]#

Bases: HomieChildParams

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

devices

list[str] | None

No

None

min_length=1

label

str | None

No

None

min_length=1

origin

str | None

No

None

min_length=1

origin: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Origin where group exists', metadata=[MinLen(min_length=1)])]#
label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Group name in the origin', metadata=[MinLen(min_length=1)])]#
devices: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='List of devices in group', metadata=[MinLen(min_length=1)])]#
class enhomie.homie.params.HomieSceneParams[source]#

Bases: HomieChildParams

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

devices

dict[str, HomieStageParams] | None

No

None

min_length=1

label

str | None

No

None

min_length=1

stage

HomieStageParams

No

factory

label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Scene name in the origin', metadata=[MinLen(min_length=1)])]#
stage: Annotated[HomieStageParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomieStageParams, description='Default device scene config')]#
devices: Annotated[dict[str, HomieStageParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Device specific scene config', metadata=[MinLen(min_length=1)])]#
class enhomie.homie.params.HomieAspireParams[source]#

Bases: HomieChildParams

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

devices

list[str] | None

No

None

min_length=1

groups

list[str] | None

No

None

min_length=1

occurs

list[HomieOccurParams] | None

No

None

min_length=1

pause

int

No

3

ge=1, le=86400

scene

str | None

No

None

min_length=1

stage

HomieStageParams | None

No

None

store

list[HomieStoreParams] | None

No

None

min_length=1

wheres

list[HomieWhereParams] | None

No

None

min_length=1

devices: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Devices that are in scope', metadata=[MinLen(min_length=1)])]#
groups: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Groups that are in scope', metadata=[MinLen(min_length=1)])]#
stage: Annotated[HomieStageParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Default device scene config')]#
scene: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Update the group light scene', metadata=[MinLen(min_length=1)])]#
store: Annotated[list[HomieStoreParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Update values in database', metadata=[MinLen(min_length=1)])]#
occurs: Annotated[list[HomieOccurParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugins for the conditions', metadata=[MinLen(min_length=1)])]#
wheres: Annotated[list[HomieWhereParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugins for the conditions', metadata=[MinLen(min_length=1)])]#
pause: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=3, description='Delay before acting again', metadata=[Ge(ge=1), Le(le=86400)])]#
class enhomie.homie.params.HomieDesireParams[source]#

Bases: HomieChildParams

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

delay

bool

No

True

devices

list[str] | None

No

None

min_length=1

groups

list[str] | None

No

None

min_length=1

pause

int

No

0

ge=0, le=86400

scene

str | None

No

None

min_length=1

stage

HomieStageParams | None

No

None

store

list[HomieStoreParams] | None

No

None

min_length=1

weight

int

No

0

ge=0, le=1000.0

wheres

list[HomieWhereParams] | None

No

None

min_length=1

devices: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Devices that are in scope', metadata=[MinLen(min_length=1)])]#
groups: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Groups that are in scope', metadata=[MinLen(min_length=1)])]#
stage: Annotated[HomieStageParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Default device scene config')]#
scene: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Update the group light scene', metadata=[MinLen(min_length=1)])]#
store: Annotated[list[HomieStoreParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Update values in database', metadata=[MinLen(min_length=1)])]#
wheres: Annotated[list[HomieWhereParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugins for the conditions', metadata=[MinLen(min_length=1)])]#
pause: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=0, description='Delay before acting again', metadata=[Ge(ge=0), Le(le=86400)])]#
delay: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Enforce pause on initial')]#
weight: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=0, description='Precedence when multiple', metadata=[Ge(ge=0), Le(le=1000.0)])]#
class enhomie.homie.params.HomieServiceParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

members

HomieServiceMembersParams

No

factory

respite

HomieServiceRespiteParams

No

factory

timeout

HomieServiceTimeoutParams

No

factory

respite: Annotated[HomieServiceRespiteParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomieServiceRespiteParams, description='When operates are performed')]#
timeout: Annotated[HomieServiceTimeoutParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomieServiceTimeoutParams, description='Override source or defaults')]#
members: Annotated[HomieServiceMembersParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomieServiceMembersParams, description='Which members are created')]#
class enhomie.homie.params.HomiePluginParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

class enhomie.homie.params.HomieStoreParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

about

str | None

No

None

min_length=1

about_icon

str | None

No

None

min_length=1

about_label

str | None

No

None

min_length=1

expire

str | None

No

'1d'

min_length=1, pattern=``re.compile(‘^(\d+(s|m|h|d|w|y))*$’)``

level

Literal[‘failure’, ‘information’, ‘success’, ‘warning’] | None

No

None

min_length=1

tags

list[str] | None

No

None

min_length=1

unique

str

Yes

min_length=1

value

int | float | bool | str | None

Yes

value_icon

str | None

No

None

min_length=1

value_label

str | None

No

None

min_length=1

value_unit

str | None

No

None

min_length=1

unique: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Unique key for the value', metadata=[MinLen(min_length=1)])]#
value: Annotated[int | float | bool | str | None, FieldInfo(annotation=NoneType, required=True, description='Value stored at unique')]#
value_unit: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Unit for persist value', metadata=[MinLen(min_length=1)])]#
value_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist value', metadata=[MinLen(min_length=1)])]#
value_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist value', metadata=[MinLen(min_length=1)])]#
about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='About the persist entry', metadata=[MinLen(min_length=1)])]#
about_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist entry', metadata=[MinLen(min_length=1)])]#
about_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist entry', metadata=[MinLen(min_length=1)])]#
level: Annotated[Literal['failure', 'information', 'success', 'warning'] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Severity of persist entry', metadata=[MinLen(min_length=1)])]#
tags: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Tags for persist entry', metadata=[MinLen(min_length=1)])]#
expire: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='After when the key expires', examples=['1h', '1h30m', '1d'], metadata=[MinLen(min_length=1), _PydanticGeneralMetadata(pattern=re.compile('^(\\d+(s|m|h|d|w|y))*$'))])]#
class enhomie.homie.params.HomieOccurParams[source]#

Bases: HomiePluginParams

Process and validate the Homie configuration parameters.

builtins_regexp: Annotated[DriverBltnRegexpParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugin for the operations')]#
philips_button: Annotated[DriverPhueButtonParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugin for the operations')]#
philips_contact: Annotated[DriverPhueContactParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugin for the operations')]#
philips_motion: Annotated[DriverPhueMotionParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugin for the operations')]#
philips_scene: Annotated[DriverPhueSceneParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugin for the operations')]#
class enhomie.homie.params.HomieWhereParams[source]#

Bases: HomiePluginParams

Process and validate the Homie configuration parameters.

Note

When using the default family, the conditons are in an AND relationship. If another name is given for family, those will be with an OR relationship.

Fields#

Field

Type

Required

Default

Constraints

builtins_period

DriverBltnPeriodParams | None

No

None

builtins_store

DriverBltnStoreParams | None

No

None

family

str

No

'default'

min_length=1

negate

bool

No

False

philips_change

DriverPhueChangeParams | None

No

None

ubiquiti_client

DriverUbiqClientParams | None

No

None

negate: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Invert conditional outcome')]#
family: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='default', description='Combine conditions in group', metadata=[MinLen(min_length=1)])]#
builtins_store: Annotated[DriverBltnStoreParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugin for the operations')]#
builtins_period: Annotated[DriverBltnPeriodParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugin for the operations')]#
philips_change: Annotated[DriverPhueChangeParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugin for the operations')]#
ubiquiti_client: Annotated[DriverUbiqClientParams | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Plugin for the operations')]#

Homie Children#

class enhomie.homie.childs.HomieChild(homie: Homie, name: str, params: HomieChildParams)[source]#

Bases: object

Parent object for child objects within the project base.

Parameters:
  • homie – Primary class instance for Homie Automate.

  • name – Name of the object within the Homie config.

  • params – Parameters used to instantiate the class.

validate() None[source]#

Perform advanced validation on the parameters provided.

property homie: Homie#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property name: str#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property family: HomieFamily#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kind: HomieKinds#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieChildParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

class enhomie.homie.childs.HomieChilds(homie: Homie)[source]#

Bases: object

Contain the object instances for related Homie children.

Parameters:

homie – Primary class instance for Homie Automate.

build_objects() None[source]#

Construct instances using the configuration parameters.

validate() None[source]#

Perform advanced validation on the parameters provided.

property origins: dict[str, HomieOrigin]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property devices: dict[str, HomieDevice]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property groups: dict[str, HomieGroup]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property scenes: dict[str, HomieScene]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property desires: dict[str, HomieDesire]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property aspires: dict[str, HomieAspire]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

get_origin(name: str) Type[HomieOrigin][source]#

Return the Homie class definition for its instantiation.

Parameters:

name – Name of the object within the Homie config.

Returns:

Homie class definition for its instantiation.

get_device(name: str) Type[HomieDevice][source]#

Return the Homie class definition for its instantiation.

Parameters:

name – Name of the object within the Homie config.

Returns:

Homie class definition for its instantiation.

class enhomie.homie.childs.HomieOrigin(homie: Homie, name: str, params: HomieChildParams)[source]#

Bases: HomieChild

Normalize the desired parameters with multiple products.

validate() None[source]#

Perform advanced validation on the parameters provided.

property family: HomieFamily#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kind: Literal['origin']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieOriginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

refresh(timeout: int | None = None) bool[source]#

Refresh the cached information for the remote upstream.

Parameters:

timeout – Timeout waiting for the server response.

Returns:

Boolean indicating the success of the refresh.

source(kind: HomieKinds | None = None, unique: str | None = None, label: str | None = None, relate: HomieActionNode | None = None) dict[str, Any] | None[source]#

Return the content related to the item in parent system.

Parameters:
  • kind – Which kind of Homie object will be located.

  • unique – Unique identifier within parents system.

  • label – Friendly name or label within the parent.

  • relate – Child class instance for Homie Automate.

Returns:

Content related to the item in parent system.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

get_action(target: HomieActionNode, *, state: HomieState | None = None, color: str | Color | None = None, level: int | None = None, scene: str | HomieScene | None = None) HomieActionItem[source]#

Return the new item containing information for operation.

Parameters:
  • target – Device or group settings will be updated.

  • state – Determine the state related to the target.

  • color – Determine the color related to the target.

  • level – Determine the level related to the target.

  • scene – Determine the scene related to the target.

Returns:

New item containing information for operation.

set_action(target: HomieActionNode, aitem: HomieActionItem, force: bool = False, change: bool = True, timeout: int | None = None) bool[source]#

Perform the provided action with specified Homie target.

Parameters:
  • target – Device or group settings will be updated.

  • aitem – Item containing information for operation.

  • force – Override the default for full idempotency.

  • change – Determine whether the change is executed.

  • timeout – Timeout waiting for the server response.

Returns:

Boolean indicating whether or not was changed.

put_action(aqueue: HomieQueue[HomieActionItem], target: HomieActionNode, *, state: HomieState | None = None, color: str | Color | None = None, level: int | None = None, scene: str | HomieScene | None = None) None[source]#

Insert the new item containing information for operation.

Parameters:
  • aqueue – Queue instance where the item is received.

  • target – Device or group settings will be updated.

  • state – Determine the state related to the target.

  • color – Determine the color related to the target.

  • level – Determine the level related to the target.

  • scene – Determine the scene related to the target.

get_update() HomieUpdateItem[source]#

Return the new item containing information for operation.

Returns:

New item containing information for operation.

set_update(uitem: HomieUpdateBase) bool[source]#

Replace or update internal configuration with provided.

Parameters:

uitem – Item containing information for operation.

Returns:

Boolean indicating whether or not was changed.

put_update(uqueue: HomieQueue[HomieUpdateItem]) None[source]#

Insert the new item containing information for operation.

Parameters:

uqueue – Queue instance where the item is received.

get_stream(event: dict[str, Any]) HomieStreamItem[source]#

Return the new item containing information for operation.

Parameters:

event – Event from the stream for creating object.

Returns:

New item containing information for operation.

put_stream(squeue: HomieQueue[HomieStreamItem], event: dict[str, Any]) None[source]#

Insert the new item containing information for operation.

Parameters:
  • squeue – Queue instance where the item is received.

  • event – Event from the stream for creating object.

class enhomie.homie.childs.HomieDevice(homie: Homie, name: str, params: HomieChildParams)[source]#

Bases: HomieChild

Normalize the desired parameters with multiple products.

validate() None[source]#

Perform advanced validation on the parameters provided.

property kind: Literal['device']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property origin: HomieOrigin#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieDeviceParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property source: dict[str, Any] | None#

Return the content related to the item in parent system.

Returns:

Content related to the item in parent system.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

class enhomie.homie.childs.HomieGroup(homie: Homie, name: str, params: HomieChildParams)[source]#

Bases: HomieChild

Normalize the desired parameters with multiple products.

validate() None[source]#

Perform advanced validation on the parameters provided.

property kind: Literal['group']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property origin: HomieOrigin | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieGroupParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property source: dict[str, Any] | None#

Return the content related to the item in parent system.

Returns:

Content related to the item in parent system.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

class enhomie.homie.childs.HomieScene(homie: Homie, name: str, params: HomieChildParams)[source]#

Bases: HomieChild

Normalize the desired parameters with multiple products.

validate() None[source]#

Perform advanced validation on the parameters provided.

property kind: Literal['scene']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieSceneParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

source(origin: HomieOrigin, relate: HomieActionNode | None = None) dict[str, Any] | None[source]#

Return the content related to the item in parent system.

Parameters:
  • origin – Child class instance for Homie Automate.

  • relate – Child class instance for Homie Automate.

Returns:

Content related to the item in parent system.

stage(device: HomieDevice | None = None) HomieStage[source]#

Return the configuration for the device or the defaults.

Parameters:

device – Child class instance for Homie Automate.

Returns:

Configuration for the device or the defaults.

class enhomie.homie.childs.HomieAspire(homie: Homie, name: str, params: HomieChildParams)[source]#

Bases: HomieChild

Match specific conditions for determining desired state.

validate() None[source]#

Perform advanced validation on the parameters provided.

property kind: Literal['aspire']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieAspireParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property devices: list[HomieDevice]#

Return the value for the attribute from class instance.

Note

This method is identical to same within HomieDesire.

Returns:

Value for the attribute from class instance.

property groups: list[HomieGroup]#

Return the value for the attribute from class instance.

Note

This method is identical to same within HomieDesire.

Returns:

Value for the attribute from class instance.

property occurs: list[HomieOccur]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property wheres: list[HomieWhere]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

when(sitem: HomieStreamItem) bool[source]#

Return the boolean indicating the conditional outcomes.

Note

Somewhat similar to same method within HomieDesire.

Parameters:

sitem – Item containing information for operation.

Returns:

Boolean indicating the conditional outcomes.

property paused: bool#

Return the boolean indicating whether operation delayed.

Note

Somewhat similar to same method within HomieDesire.

Returns:

Boolean indicating whether operation delayed.

matched() None[source]#

Perform operations when this desire is the most desired.

Note

Somewhat similar to same method within HomieDesire.

class enhomie.homie.childs.HomieDesire(homie: Homie, name: str, params: HomieChildParams)[source]#

Bases: HomieChild

Match specific conditions for determining desired state.

validate() None[source]#

Perform advanced validation on the parameters provided.

property kind: Literal['desire']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieDesireParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property weight: int#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property devices: list[HomieDevice]#

Return the value for the attribute from class instance.

Note

This method is identical to same within HomieAspire.

Returns:

Value for the attribute from class instance.

property groups: list[HomieGroup]#

Return the value for the attribute from class instance.

Note

This method is identical to same within HomieAspire.

Returns:

Value for the attribute from class instance.

property wheres: list[HomieWhere]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

when(time: Time) bool[source]#

Return the boolean indicating the conditional outcomes.

Note

Somewhat similar to same method within HomieAspire.

Parameters:

time – Time that will be used in the conditionals.

Returns:

Boolean indicating the conditional outcomes.

paused(target: HomieActionNode) bool[source]#

Return the boolean indicating whether operation delayed.

Note

This method is identical to same within HomieAspire.

Parameters:

target – Device or group that in scope for match.

Returns:

Boolean indicating whether operation delayed.

matched(target: HomieActionNode) None[source]#

Perform operations when this desire is the most desired.

Note

Somewhat similar to same method within HomieAspire.

Parameters:

target – Device or group that in scope for match.

omitted(target: HomieActionNode | None = None) None[source]#

Perform operations when this desire is the most desired.

Note

Somewhat similar to same method within HomieAspire.

Parameters:

target – Device or group that in scope for match.

Homie Add-ons#

class enhomie.homie.addons.HomieLogger(homie: Homie)[source]#

Bases: object

Methods for extending use of underlying logging library.

Parameters:

homie – Primary class instance for Homie Automate.

start() None[source]#

Initialize the Python logging library using parameters.

stop() None[source]#

Deinitialize the Python logging library using parameters.

log(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log().

Parameters:

kwargs – Keyword arguments for populating message.

log_c(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log_c().

Parameters:

kwargs – Keyword arguments for populating message.

log_d(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log_d().

Parameters:

kwargs – Keyword arguments for populating message.

log_e(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log_e().

Parameters:

kwargs – Keyword arguments for populating message.

log_i(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log_i().

Parameters:

kwargs – Keyword arguments for populating message.

log_w(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log_w().

Parameters:

kwargs – Keyword arguments for populating message.

class enhomie.homie.addons.HomieJinja2(homie: Homie)[source]#

Bases: Jinja2

Parse the provided input and intelligently return value.

Parameters:

homie – Primary class instance for Homie Automate.

class enhomie.homie.addons.HomieQueue(homie: Homie, size: int = 10000)[source]#

Bases: Generic[HomieQueueItemType]

Queue object that will allow to handle full conditions.

Parameters:
  • homie – Primary class instance for Homie Automate.

  • size – Maximum size for the created queue object.

property empty: bool#

Return the boolean indicating whether the queue is full.

Returns:

Boolean indicating whether the queue is full.

property qsize: int#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

put(item: HomieQueueItemType) None[source]#

Store the provided item within the queue class instance.

Parameters:

item – Item containing information for operation.

get() HomieQueueItemType[source]#

Return the next item within the queue in blocking mode.

Returns:

Next item within the queue in blocking mode.

class enhomie.homie.addons.HomieQueueItem[source]#

Bases: object

Contain information for sharing using the Python queue.

time: Time#
class enhomie.homie.addons.HomieAspired(homie: Homie)[source]#

Bases: object

Contain information related to the aspired child state.

Parameters:

homie – Primary class instance for Homie Automate.

items(sitem: HomieStreamItem) list[HomieAspiredItem][source]#

Return the action state objects for the related targets.

..note::

Somewhat similar to same method within HomieDesire.

Parameters:

sitem – Item containing information for operation.

Returns:

Action state objects for the related targets.

class enhomie.homie.addons.HomieAspiredItem(target: HomieActionNode, aspire: HomieAspire)[source]#

Bases: object

Contain information related to the aspired child state.

target: HomieActionNode#
aspire: HomieAspire#
scene: HomieScene | None = None#
state: HomieState | None = None#
color: str | None = None#
level: int | None = None#
class enhomie.homie.addons.HomieDesired(homie: Homie)[source]#

Bases: object

Contain information related to the desired child state.

Parameters:

homie – Primary class instance for Homie Automate.

items(time: Time) list[HomieDesiredItem][source]#

Return the action state objects for the related targets.

..note::

Somewhat similar to same method within HomieAspire.

Parameters:

time – Time that will be used in the conditionals.

Returns:

Action state objects for the related targets.

class enhomie.homie.addons.HomieDesiredItem(target: HomieActionNode, desire: HomieDesire)[source]#

Bases: object

Contain information related to the desired child state.

target: HomieActionNode#
weight: int#
desire: HomieDesire#
scene: HomieScene | None = None#
state: HomieState | None = None#
color: str | None = None#
level: int | None = None#
property paused: bool#

Return the boolean indicating whether operation delayed.

Returns:

Boolean indicating whether operation delayed.

property applied: bool#

Return the boolean indicating that there will be change.

Returns:

Boolean indicating that there will be change.

matched() None[source]#

Perform operations when this desire is the most desired.

omitted() None[source]#

Perform operations when this desire is the most desired.

class enhomie.homie.addons.HomiePersist(homie: Homie)[source]#

Bases: object

Store the persistent information in the key value store.

Parameters:

homie – Primary class instance for Homie Automate.

insert(unique: str, value: int | float | bool | str | None, expire: int | float | str | None = None, *, value_unit: str | None = None, value_label: str | None = None, value_icon: str | None = None, about: str | None = None, about_label: str | None = None, about_icon: str | None = None, level: Literal['failure', 'information', 'success', 'warning'] | None = None, tags: list[str] | None = None, statics: dict[str, Any] | None = None) None[source]#

Insert the value within the persistent key value store.

select(unique: str) int | float | bool | str | None[source]#

Return the value from within persistent key value store.

Parameters:

unique – Unique identifier from within the table.

Returns:

Value from within persistent key value store.

delete(unique: str) None[source]#

Delete the value within the persistent key value store.

Parameters:

unique – Unique identifier from within the table.

expire() None[source]#

Remove the expired persistent key values from the table.

record(unique: str) HomiePersistRecord[source]#

Return the record within the persistent key value store.

Parameters:

unique – Unique identifier from within the table.

Returns:

Record within the persistent key value store.

records() list[HomiePersistRecord][source]#

Return all records within the persistent key value store.

Returns:

Records within the persistent key value store.

class enhomie.homie.addons.HomiePersistRecord[source]#

Bases: BaseModel

Contain the information regarding the persistent value.

Parameters:
  • record – Record from the SQLAlchemy query routine.

  • kwargs – Keyword arguments passed for downstream.

Fields#

Field

Type

Required

Default

Constraints

about

str | None

No

None

min_length=1

about_icon

str | None

No

None

min_length=1

about_label

str | None

No

None

min_length=1

expire

str | None

No

None

min_length=20, max_length=32

level

Literal[‘failure’, ‘information’, ‘success’, ‘warning’] | None

No

None

min_length=1

tags

list[str] | None

No

None

min_length=1

unique

str

Yes

min_length=1

update

str

Yes

min_length=20, max_length=32

value

int | float | bool | str | None

Yes

value_icon

str | None

No

None

min_length=1

value_label

str | None

No

None

min_length=1

value_unit

str | None

No

None

min_length=1

unique: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Unique key for the value', metadata=[MinLen(min_length=1)])]#
value: Annotated[int | float | bool | str | None, FieldInfo(annotation=NoneType, required=True, description='Value stored at unique')]#
value_unit: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Unit for persist value', metadata=[MinLen(min_length=1)])]#
value_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist value', metadata=[MinLen(min_length=1)])]#
value_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist value', metadata=[MinLen(min_length=1)])]#
about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='About the persist entry', metadata=[MinLen(min_length=1)])]#
about_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist entry', metadata=[MinLen(min_length=1)])]#
about_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist entry', metadata=[MinLen(min_length=1)])]#
level: Annotated[Literal['failure', 'information', 'success', 'warning'] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Severity of persist entry', metadata=[MinLen(min_length=1)])]#
tags: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Tags for persist entry', metadata=[MinLen(min_length=1)])]#
expire: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='After when the key expires', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])]#
update: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='When the value was updated', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])]#

Homie Members#

class enhomie.homie.members.HomieMember(service: HomieService)[source]#

Bases: object

Common methods and routines for Homie Automate members.

Parameters:

homie – Primary class instance for Homie Automate.

property homie: Homie#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property service: HomieService#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property threads: dict[str, HomieThread]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property aqueue: HomieQueue[HomieActionItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property uqueue: HomieQueue[HomieUpdateItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property squeue: HomieQueue[HomieStreamItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property vacate: Event#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property cancel: Event#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property running: list[str]#

Return the list of threads which are determined running.

Returns:

List of threads which are determined running.

property zombies: list[str]#

Return the list of threads which are determined zombies.

Returns:

List of threads which are determined zombies.

property congest: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

property enqueue: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

start() None[source]#

Start the various threads within the Homie class object.

operate() None[source]#

Perform the operation related to Homie service members.

operate_updates() None[source]#

Perform the operation related to Homie service members.

soft() None[source]#

Stop the various threads within the Homie class object.

stop() None[source]#

Stop the various threads within the Homie class object.

get_thread(origin: HomieOrigin) Type[HomieThread] | None[source]#

Return the Homie class definition for its instantiation.

Parameters:

origin – Child class instance for Homie Automate.

Returns:

Homie class definition for its instantiation.

class enhomie.homie.members.HomieActions(service: HomieService)[source]#

Bases: HomieMember

Common methods and routines for Homie Automate members.

operate() None[source]#

Perform the operation related to Homie service members.

operate_desires() None[source]#

Perform the operation related to Homie service members.

operate_aspires() None[source]#

Perform the operation related to Homie service members.

operate_actions() None[source]#

Perform the operation related to Homie service members.

get_thread(origin: HomieOrigin) Type[HomieThread] | None[source]#

Return the Homie class definition for its instantiation.

Parameters:

origin – Child class instance for Homie Automate.

Returns:

Homie class definition for its instantiation.

put_actions(target: HomieActionNode, *, state: HomieState | None = None, color: str | None = None, level: int | None = None, scene: HomieScene | None = None) None[source]#

Insert the new item containing information for operation.

Parameters:
  • target – Device or group settings will be updated.

  • state – Determine the state related to the target.

  • color – Determine the color related to the target.

  • level – Determine the level related to the target.

  • scene – Determine the scene related to the target.

class enhomie.homie.members.HomieUpdates(service: HomieService)[source]#

Bases: HomieMember

Common methods and routines for Homie Automate members.

operate() None[source]#

Perform the operation related to Homie service members.

operate_streams() None[source]#

Perform the operation related to Homie service members.

get_thread(origin: HomieOrigin) Type[HomieThread] | None[source]#

Return the Homie class definition for its instantiation.

Parameters:

origin – Child class instance for Homie Automate.

Returns:

Homie class definition for its instantiation.

class enhomie.homie.members.HomieStreams(service: HomieService)[source]#

Bases: HomieMember

Common methods and routines for Homie Automate members.

operate() None[source]#

Perform the operation related to Homie service members.

get_thread(origin: HomieOrigin) Type[HomieThread] | None[source]#

Return the Homie class definition for its instantiation.

Parameters:

origin – Child class instance for Homie Automate.

Returns:

Homie class definition for its instantiation.

class enhomie.homie.members.HomieRestful(service: HomieService)[source]#

Bases: HomieMember

Common methods and routines for Homie Automate members.

property restful: RestfulService#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property running: list[str]#

Return the list of threads which are determined running.

Returns:

List of threads which are determined running.

property zombies: list[str]#

Return the list of threads which are determined zombies.

Returns:

List of threads which are determined zombies.

operate() None[source]#

Perform the operation related to Homie service members.

operate_updates() None[source]#

Perform the operation related to Homie service members.

soft() None[source]#

Stop the various threads within the Homie class object.

stop() None[source]#

Stop the various threads within the Homie class object.

get_thread(origin: HomieOrigin) Type[HomieThread] | None[source]#

Return the Homie class definition for its instantiation.

Parameters:

origin – Child class instance for Homie Automate.

Returns:

Homie class definition for its instantiation.

Homie Threads#

class enhomie.homie.threads.HomieThread(member: HomieMember, origin: HomieOrigin)[source]#

Bases: Thread

Common methods and routines for Homie Automate threads.

Parameters:
  • member – Child class instance for Homie Automate.

  • origin – Child class instance for Homie Automate.

property homie: Homie#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property service: HomieService#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property member: HomieMember#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property origin: HomieOrigin#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property aqueue: HomieQueue[HomieActionItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property uqueue: HomieQueue[HomieUpdateItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property squeue: HomieQueue[HomieStreamItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

expired(item: HomieThreadItem) bool[source]#

Return the boolean indicating whether the item expired.

Parameters:

item – Item containing information for operation.

Returns:

Boolean indicating whether the item expired.

property congest: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

property enqueue: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

run() None[source]#

Perform whatever operation is associated with the class.

operate() None[source]#

Perform the operation related to Homie service threads.

operate_updates() None[source]#

Perform the operation related to Homie service threads.

stop() None[source]#

Wait for the thread object to complete routine and exit.

class enhomie.homie.threads.HomieThreadItem(origin: HomieOrigin)[source]#

Bases: HomieQueueItem

Contain information for sharing using the Python queue.

origin: str#
class enhomie.homie.threads.HomieAction(member: HomieMember, origin: HomieOrigin)[source]#

Bases: HomieThread

Common methods and routines for Homie Automate threads.

property member: HomieActions#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Homie service threads.

execute(aitem: HomieActionItem) None[source]#

Perform the operation related to Homie service threads.

Parameters:

aitem – Item containing information for operation.

class enhomie.homie.threads.HomieActionItem(origin: HomieOrigin, target: HomieGroup | HomieDevice, *, state: HomieState | None = None, color: str | Color | None = None, level: int | None = None, scene: HomieScene | None = None)[source]#

Bases: HomieThreadItem

Contain information for sharing using the Python queue.

group: str | None = None#
device: str | None = None#
state: HomieState | None = None#
color: Color | None = None#
level: int | None = None#
scene: str | None = None#
class enhomie.homie.threads.HomieStream(member: HomieMember, origin: HomieOrigin)[source]#

Bases: HomieThread

Common methods and routines for Homie Automate threads.

property member: HomieStreams#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Homie service threads.

operate_streams() None[source]#

Perform the operation related to Homie service threads.

class enhomie.homie.threads.HomieStreamItem(origin: HomieOrigin, event: dict[str, Any])[source]#

Bases: HomieThreadItem

Contain information for sharing using the Python queue.

event: dict[str, Any]#
class enhomie.homie.threads.HomieUpdate(*args: Any, **kwargs: Any)[source]#

Bases: HomieThread

Common methods and routines for Homie Automate threads.

property member: HomieUpdates#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Homie service threads.

operate_updates() None[source]#

Perform the operation related to Homie service threads.

class enhomie.homie.threads.HomieUpdateItem(origin: HomieOrigin)[source]#

Bases: HomieThreadItem

Contain information for sharing using the Python queue.

Homie Plugins#

class enhomie.homie.plugins.HomiePlugin(homie: Homie, params: HomiePluginParams)[source]#

Bases: object

Match specific conditions for determining desired state.

Parameters:
  • homie – Primary class instance for Homie Automate.

  • params – Parameters used to instantiate the class.

validate() None[source]#

Perform advanced validation on the parameters provided.

property homie: Homie#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property family: HomieFamily#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kind: HomiePluginKinds#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomiePluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property drivers: list[HomieDriver]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

get_drivers() dict[str, Type[HomieDriver]][source]#

Return the Homie class definition for its instantiation.

Returns:

Homie class definition for its instantiation.

class enhomie.homie.plugins.HomieWhere(homie: Homie, params: HomiePluginParams)[source]#

Bases: HomiePlugin

Match specific conditions for determining desired state.

validate() None[source]#

Perform advanced validation on the parameters provided.

property kind: Literal['where']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieWhereParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

get_drivers() dict[str, Type[HomieDriver]][source]#

Return the Homie class definition for its instantiation.

Returns:

Homie class definition for its instantiation.

when(time: Time) bool[source]#

Return the boolean indicating the conditional outcomes.

Note

Somewhat similar to same method within HomieOccur.

Parameters:

time – Time that will be used in the conditionals.

Returns:

Boolean indicating the conditional outcomes.

class enhomie.homie.plugins.HomieOccur(homie: Homie, params: HomiePluginParams)[source]#

Bases: HomiePlugin

Match specific conditions for determining desired state.

validate() None[source]#

Perform advanced validation on the parameters provided.

property kind: Literal['occur']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieOccurParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

get_drivers() dict[str, Type[HomieDriver]][source]#

Return the Homie class definition for its instantiation.

Returns:

Homie class definition for its instantiation.

when(sitem: HomieStreamItem) bool[source]#

Return the boolean indicating the conditional outcomes.

Note

Somewhat similar to same method within HomieWhere.

Parameters:

sitem – Item containing information for operation.

Returns:

Boolean indicating the conditional outcomes.

class enhomie.homie.plugins.HomieDriver(plugin: HomiePlugin, params: HomieParamsModel)[source]#

Bases: object

Match specific conditions for determining desired state.

Parameters:
  • plugin – Plugin class instance for Homie Automate.

  • params – Parameters used to instantiate the class.

validate() None[source]#

Perform advanced validation on the parameters provided.

property plugin: HomiePlugin#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property family: HomieFamily#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kinds: list[HomiePluginKinds]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: HomieParamsModel#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

occur(sitem: HomieStreamItem) bool[source]#

Return the boolean indicating the conditional outcomes.

Parameters:

sitem – Item containing information for operation.

Returns:

Boolean indicating the conditional outcomes.

where(time: Time) bool[source]#

Return the boolean indicating the conditional outcomes.

Parameters:

time – Time that will be used in the conditionals.

Returns:

Boolean indicating the conditional outcomes.

Homie RESTful#

class enhomie.restful.RestfulService(homie: Homie)[source]#

Bases: object

Application programming interface using Homie Automate.

Parameters:

homie – Primary class instance for Homie Automate.

property homie: Homie#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property params: RestfulServiceParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property fastapi: FastAPI | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property running: bool#

Return the list of threads which are determined running.

Returns:

List of threads which are determined running.

start() None[source]#

Start the various threads within the Homie class object.

operate() None[source]#

Perform the operation related to Homie service members.

stop(*args: Any, **kwargs: Any) None[source]#

Stop the various threads within the Homie class object.

Parameters:
  • kwargs – Keyword arguments ignored by the method.

  • args – Positional arguments ignored by the method.

class enhomie.restful.RestfulServiceParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

authenticate

dict[str, str] | None

No

None

min_length=1

bind_addr

str

No

'127.0.0.1'

min_length=1

bind_port

int

No

8420

ge=0, le=65535

ssl_capem

str | None

No

None

min_length=1

ssl_mykey

str | None

No

None

min_length=1

ssl_mypem

str | None

No

None

min_length=1

bind_addr: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='127.0.0.1', description='Which local address to bind', metadata=[MinLen(min_length=1)])]#
bind_port: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=8420, description='Which port on address to bind', metadata=[Ge(ge=0), Le(le=65535)])]#
authenticate: Annotated[dict[str, str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Credentials for authentication', metadata=[MinLen(min_length=1)])]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Filesystem path to certificate', metadata=[MinLen(min_length=1)])]#
ssl_mypem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Filesystem path to certificate', metadata=[MinLen(min_length=1)])]#
ssl_mykey: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Filesystem path to certificate', metadata=[MinLen(min_length=1)])]#

Homie Examples#

Origins#

origins/hubitat.yml#
---



origins:


  ####################
  ## Jupiter Bridge ##
  ####################
  jupiter_hubitat:
    hubitat:
      bridge:
        server: 192.168.1.11
        appid: 69
        token: XxXXXxXxXXxXXXxXXxXXxXXXxXXXxxXxXXX
        ssl_verify: false


  ####################
  ## Neptune Bridge ##
  ####################
  neptune_hubitat:
    hubitat:
      bridge:
        server: 192.168.2.11
        appid: 69
        token: XxXXXxXxXXxXXXxXXxXXxXXXxXXXxxXxXXX
        ssl_verify: false
origins/philips.yml#
---



origins:


  ####################
  ## Jupiter Bridge ##
  ####################
  jupiter_philips:
    philips:
      bridge:
        server: 192.168.1.10
        token: XxXXXxXxXXxXXXxXXxXXxXXXxXXXxxXxXXX
        ssl_verify: false


  ####################
  ## Neptune Bridge ##
  ####################
  neptune_philips:
    philips:
      bridge:
        server: 192.168.2.10
        token: XxXXXxXxXXxXXXxXXxXXxXXXxXXXxxXxXXX
        ssl_verify: false
origins/ubiquiti.yml#
---



origins:


  ####################
  ## Jupiter Router ##
  ####################
  jupiter_ubiquiti:
    ubiquiti:
      router:
        server: 192.168.1.1
        username: username
        password: XxXXXxXxXXxXXXx
        site: default
        ssl_verify: false


  ####################
  ## Neptune Router ##
  ####################
  neptune_ubiquiti:
    ubiquiti:
      router:
        server: 192.168.2.1
        username: username
        password: XxXXXxXxXXxXXXx
        site: default
        ssl_verify: false

Groups#

groups.yml#
---



groups:


  ####################
  ## Jupiter Groups ##
  ####################
  jupiter:
    origin: jupiter_philips
    label: Jupiter
  ganymede:
    origin: jupiter_philips
    label: Ganymede
    devices: jupiter_light2


  ####################
  ## Neptune Groups ##
  ####################
  neptune:
    origin: neptune_philips
    label: Neptune
  halimede:
    origin: neptune_philips
    label: Halimede
    devices: neptune_light2

Scenes#

scenes.yml#
---



scenes:


  ############
  ## Active ##
  ############
  active:
    label: Active
    stage:
      state: poweron
      color: 'fff6b0'
      level: 80


  #############
  ## Standby ##
  #############
  standby:
    label: Standby
    stage:
      state: poweron
      color: '003333'
      level: 80
    devices:
      jupiter_light2:
        level: 20
      neptune_light2:
        level: 20


  ############
  ## Absent ##
  ############
  absent:
    label: Absent
    stage:
      state: poweron
      color: '99925c'
      level: 30

Aspires#

aspires/jupiter.yml#
---



aspires:


  ####################
  ## Jupiter Active ##
  ####################
  jupiter_active:

    groups: ganymede
    devices:
      - jupiter_special

    scene: active

    stage:
      state: poweron
      level: 100

    pause: 1

    store:

      - unique: jupiter_aspire
        value: active

    occurs:

      - philips_contact:
          device: jupiter_contact
          states: no_contact

      - philips_button:
          device: jupiter_button
          sensor: button1
          events: short_release

      - philips_button:
          device: jupiter_switch
          sensor: button1
          events: short_release

      - philips_motion:
          device: jupiter_motion
          states: motion

      - philips_scene:
          scene: active
          group: ganymede
          states: active

      - builtins_regexp:
          patterns: '\S+foo.+?bar\S+'

    wheres:

      - builtins_store:
          unique: jupiter_aspire
          value: active
          operator: neq


  #####################
  ## Jupiter Standby ##
  #####################
  jupiter_standby:

    groups: ganymede
    devices:
      - jupiter_special

    scene: standby

    pause: 1

    store:

      - unique: jupiter_aspire
        value: standby

    occurs:

      - philips_button:
          device: jupiter_button
          sensor: button1
          events: short_release

      - philips_button:
          device: jupiter_switch
          sensor: button1
          events: short_release

    wheres:

      - builtins_store:
          unique: jupiter_aspire
          value: active
          operator: eq
aspires/neptune.yml#
---



aspires:


  ####################
  ## Neptune Active ##
  ####################
  neptune_active:

    groups: halimede
    devices:
      - neptune_special

    scene: active

    stage:
      state: poweron
      level: 100

    pause: 1

    store:

      - unique: neptune_aspire
        value: active

    occurs:

      - philips_contact:
          device: neptune_contact
          states: no_contact

      - philips_button:
          device: neptune_button
          sensor: button1
          events: short_release

      - philips_button:
          device: neptune_switch
          sensor: button1
          events: short_release

      - philips_motion:
          device: neptune_motion
          states: motion

      - philips_scene:
          scene: active
          group: halimede
          states: active

      - builtins_regexp:
          patterns: '\S+foo.+?bar\S+'

    wheres:

      - builtins_store:
          unique: neptune_aspire
          value: active
          operator: neq


  #####################
  ## Neptune Standby ##
  #####################
  neptune_standby:

    groups: halimede
    devices:
      - neptune_special

    scene: standby

    pause: 1

    store:

      - unique: neptune_aspire
        value: standby

    occurs:

      - philips_button:
          device: neptune_button
          sensor: button1
          events: short_release

      - philips_button:
          device: neptune_switch
          sensor: button1
          events: short_release

    wheres:

      - builtins_store:
          unique: neptune_aspire
          value: active
          operator: eq

Desires#

desires/jupiter.yml#
---



desires:


  ####################
  ## Jupiter Active ##
  ####################
  jupiter_active:

    groups: ganymede
    devices:
      - jupiter_special

    scene: active

    stage:
      state: poweron
      level: 100

    pause: 1

    store:

      - unique: jupiter_desire
        value: active

    wheres:

      - builtins_store:
          unique: jupiter_aspire
          value: active
          operator: eq
        family: active
      - philips_change:
          devices:
            - jupiter_motion
            - jupiter_button
            - jupiter_contact
            - jupiter_switch
          sensors:
            - motion
            - temperature
          since: 900
        negate: true
        family: active

      - builtins_store:
          unique: jupiter_aspire
          value: standby
          operator: neq

      - builtins_period:
          start: '00:00'
          stop: '07:00'
          tzname: US/Central
        family: schedule
      - builtins_period:
          start: '07:00'
          tzname: US/Central
        family: schedule



  #####################
  ## Jupiter Standby ##
  #####################
  jupiter_standby:

    groups: ganymede
    devices:
      - jupiter_special

    scene: standby

    weight: 10
    pause: 1

    store:

      - unique: jupiter_desire
        value: standby

    wheres:

      - builtins_store:
          unique: jupiter_aspire
          value: standby
          operator: eq


  ####################
  ## Jupiter Absent ##
  ####################
  jupiter_absent:

    groups: ganymede
    devices:
      - jupiter_special

    scene: absent

    weight: 20
    pause: 1

    store:

      - unique: jupiter_desire
        value: absent

    wheres:

      - ubiquiti_client:
          clients:
            - jupiter_phone
            - jupiter_tablet
          since: 600
desires/neptune.yml#
---



desires:


  ####################
  ## Neptune Active ##
  ####################
  neptune_active:

    groups: halimede
    devices:
      - neptune_special

    scene: active

    stage:
      state: poweron
      level: 100

    pause: 1

    store:

      - unique: neptune_desire
        value: active

    wheres:

      - builtins_store:
          unique: neptune_aspire
          value: active
          operator: eq
        family: active
      - philips_change:
          devices:
            - neptune_motion
            - neptune_button
            - neptune_contact
            - neptune_switch
          sensors:
            - motion
            - temperature
          since: 900
        negate: true
        family: active

      - builtins_store:
          unique: neptune_aspire
          value: standby
          operator: neq

      - builtins_period:
          start: '00:00'
          stop: '07:00'
          tzname: US/Central
        family: schedule
      - builtins_period:
          start: '07:00'
          tzname: US/Central
        family: schedule



  #####################
  ## Neptune Standby ##
  #####################
  neptune_standby:

    groups: halimede
    devices:
      - neptune_special

    scene: standby

    weight: 10
    pause: 1

    store:

      - unique: neptune_desire
        value: standby

    wheres:

      - builtins_store:
          unique: neptune_aspire
          value: standby
          operator: eq


  ####################
  ## Neptune Absent ##
  ####################
  neptune_absent:

    groups: halimede
    devices:
      - neptune_special

    scene: absent

    weight: 20
    pause: 1

    store:

      - unique: neptune_desire
        value: absent

    wheres:

      - ubiquiti_client:
          clients:
            - neptune_phone
            - neptune_tablet
          since: 600

Devices#

devices/hubitat.yml#
---



devices:


  #####################
  ## Jupiter Devices ##
  #####################
  jupiter_light2:
    origin: jupiter_hubitat
    label: Jupiter Light
  jupiter_special:
    origin: jupiter_hubitat
    label: Jupiter Special


  #####################
  ## Neptune Devices ##
  #####################
  neptune_light2:
    origin: neptune_hubitat
    label: Neptune Light
  neptune_special:
    origin: neptune_hubitat
    label: Neptune Special
devices/philips.yml#
---



devices:


  #####################
  ## Jupiter Devices ##
  #####################
  jupiter_button:
    origin: jupiter_philips
    label: Jupiter Button
  jupiter_motion:
    origin: jupiter_philips
    label: Jupiter Motion
  jupiter_switch:
    origin: jupiter_philips
    label: Jupiter Switch
  jupiter_contact:
    origin: jupiter_philips
    label: Jupiter Contact
  jupiter_plug:
    origin: jupiter_philips
    label: Jupiter Plug
  jupiter_light1:
    origin: jupiter_philips
    label: Jupiter Light


  #####################
  ## Neptune Devices ##
  #####################
  neptune_button:
    origin: neptune_philips
    label: Neptune Button
  neptune_motion:
    origin: neptune_philips
    label: Neptune Motion
  neptune_switch:
    origin: neptune_philips
    label: Neptune Switch
  neptune_contact:
    origin: neptune_philips
    label: Neptune Contact
  neptune_plug:
    origin: neptune_philips
    label: Neptune Plug
  neptune_light1:
    origin: neptune_philips
    label: Neptune Light
devices/ubiquiti.yml#
---



devices:


  #####################
  ## Jupiter Devices ##
  #####################
  jupiter_phone:
    origin: jupiter_ubiquiti
    label: Phone
  jupiter_tablet:
    origin: jupiter_ubiquiti
    unique: 1a:01:68:00:11:01


  #####################
  ## Neptune Devices ##
  #####################
  neptune_phone:
    origin: neptune_ubiquiti
    label: Phone
  neptune_tablet:
    origin: neptune_ubiquiti
    unique: 1a:01:68:00:21:01

Persists#

persists.yml#
---



persists:

  jupiter_aspire:
    value_unit: status
    value_label: Current Status
    about: Aspire for Jupiter
    about_label: Jupiter Aspire
    about_icon: jupiter
    level: information
    tags: ['jupiter', 'aspire']

  neptune_aspire:
    value_unit: status
    value_label: Current Status
    about: Aspire for Neptune
    about_label: Neptune Aspire
    about_icon: neptune
    level: information
    tags: ['neptune', 'aspire']

  jupiter_desire:
    value_unit: status
    value_label: Current Status
    about: Desire for Jupiter
    about_label: Jupiter Desire
    about_icon: jupiter
    level: information
    tags: ['jupiter', 'desire']

  neptune_desire:
    value_unit: status
    value_label: Current Status
    about: Desire for Neptune
    about_label: Neptune Desire
    about_icon: neptune
    level: information
    tags: ['neptune', 'desire']

RESTful#

restful.yml#
---



restful:
  authenticate:
    username: >-
      {{ config.crypts.decrypt(
         "$ENCRYPT;1.0;enhomie;"
         "gAAAAABnssr4ATnkBC_-0"
         "XFKVpJ26zX1CUdodEkfUe"
         "Xpi_NazvIMuv-xXtbGhhv"
         "YyAj0oTjdpExJbY8_mElD"
         "opl_ySg1sxcQ0w==") }}

Hubitat Support#

class enhomie.hubitat.HubiOrigin(*args: Any, **kwargs: Any)[source]#

Bases: HomieOrigin

Contain the relevant attributes from the related source.

property family: Literal['hubitat']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property bridge: Bridge#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property fetch: list[dict[str, Any]] | None#

Return the content related to the item in parent system.

Returns:

Content related to the item in parent system.

property merge: dict[str, dict[str, Any]] | None#

Return the content related to the item in parent system.

Returns:

Content related to the item in parent system.

refresh(timeout: int | None = None) bool[source]#

Refresh the cached information for the remote upstream.

Parameters:

timeout – Timeout waiting for the server response.

Returns:

Boolean indicating the success of the refresh.

get_action(target: HomieActionNode, *, state: HomieState | None = None, color: str | Color | None = None, level: int | None = None, scene: str | HomieScene | None = None) HomieActionItem[source]#

Return the new item containing information for operation.

Note

This method is identical to same with other origins.

Parameters:
  • target – Device or group settings will be updated.

  • state – Determine the state related to the target.

  • color – Determine the color related to the target.

  • level – Determine the level related to the target.

  • scene – Determine the scene related to the target.

Returns:

New item containing information for operation.

set_action(target: HomieActionNode, aitem: HomieActionItem, force: bool = False, change: bool = True, timeout: int | None = None) bool[source]#

Perform the provided action with specified Homie target.

Parameters:
  • target – Device or group settings will be updated.

  • aitem – Item containing information for operation.

  • force – Override the default for full idempotency.

  • change – Determine whether the change is executed.

  • timeout – Timeout waiting for the server response.

Returns:

Boolean indicating whether or not was changed.

get_update() HomieUpdateItem[source]#

Return the new item containing information for operation.

Returns:

New item containing information for operation.

set_update(uitem: HomieUpdateBase) bool[source]#

Replace or update internal configuration with provided.

Parameters:

uitem – Item containing information for operation.

Returns:

Boolean indicating whether or not was changed.

source(kind: HomieKinds | None = None, unique: str | None = None, label: str | None = None, relate: HomieActionNode | None = None) dict[str, Any] | None[source]#

Return the content related to the item in parent system.

Note

This method is redundant with other origin classes.

Parameters:
  • kind – Which kind of Homie object will be located.

  • unique – Unique identifier within parents system.

  • label – Friendly name or label within the parent.

  • relate – Child class instance for Homie Automate.

Returns:

Content related to the item in parent system.

class enhomie.hubitat.HubiDevice(homie: Homie, name: str, params: HomieChildParams)[source]#

Bases: HomieDevice

Contain the relevant attributes from the related source.

property family: Literal['hubitat']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

class enhomie.hubitat.HubiAction(member: HomieMember, origin: HomieOrigin)[source]#

Bases: HomieAction

Common methods and routines for Homie Automate threads.

execute(aitem: HomieActionItem) None[source]#

Perform the operation related to Homie service threads.

Parameters:

aitem – Item containing information for operation.

class enhomie.hubitat.HubiUpdate(*args: Any, **kwargs: Any)[source]#

Bases: HomieUpdate

Common methods and routines for Homie Automate threads.

class enhomie.hubitat.HubiModels[source]#

Bases: object

Return the class object that was imported within method.

classmethod origin() Type[HubiOriginParams][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

classmethod action() Type[HubiActionItem][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

classmethod update() Type[HubiUpdateItem][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

Hubitat Parameters#

class enhomie.hubitat.params.HubiOriginParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

bridge

BridgeParams

Yes

bridge: Annotated[BridgeParams, FieldInfo(annotation=NoneType, required=True, description='Connection specific parameters')]#

Philips Support#

class enhomie.philips.PhueOrigin(*args: Any, **kwargs: Any)[source]#

Bases: HomieOrigin

Contain the relevant attributes from the related source.

property family: Literal['philips']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property bridge: Bridge#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property fetch: dict[str, Any] | None#

Return the content related to the item in parent system.

Returns:

Content related to the item in parent system.

property merge: dict[str, dict[str, Any]] | None#

Return the content related to the item in parent system.

Returns:

Content related to the item in parent system.

refresh(timeout: int | None = None) bool[source]#

Refresh the cached information for the remote upstream.

Parameters:

timeout – Timeout waiting for the server response.

Returns:

Boolean indicating the success of the refresh.

get_action(target: HomieActionNode, *, state: HomieState | None = None, color: str | Color | None = None, level: int | None = None, scene: str | HomieScene | None = None) HomieActionItem[source]#

Return the new item containing information for operation.

Note

This method is identical to same with other origins.

Parameters:
  • target – Device or group settings will be updated.

  • state – Determine the state related to the target.

  • color – Determine the color related to the target.

  • level – Determine the level related to the target.

  • scene – Determine the scene related to the target.

Returns:

New item containing information for operation.

set_action(target: HomieActionNode, aitem: HomieActionItem, force: bool = False, change: bool = True, timeout: int | None = None) bool[source]#

Perform the provided action with specified Homie target.

Parameters:
  • target – Device or group settings will be updated.

  • aitem – Item containing information for operation.

  • force – Override the default for full idempotency.

  • change – Determine whether the change is executed.

  • timeout – Timeout waiting for the server response.

Returns:

Boolean indicating whether or not was changed.

get_update() HomieUpdateItem[source]#

Return the new item containing information for operation.

Returns:

New item containing information for operation.

set_update(uitem: HomieUpdateBase) bool[source]#

Replace or update internal configuration with provided.

Parameters:

uitem – Item containing information for operation.

Returns:

Boolean indicating whether or not was changed.

get_stream(event: dict[str, Any]) HomieStreamItem[source]#

Return the new item containing information for operation.

Parameters:

event – Event from the stream for creating object.

Returns:

New item containing information for operation.

source(kind: HomieKinds | None = None, unique: str | None = None, label: str | None = None, relate: HomieActionNode | None = None) dict[str, Any] | None[source]#

Return the content related to the item in parent system.

Note

This method is redundant with other origin classes.

Parameters:
  • kind – Which kind of Homie object will be located.

  • unique – Unique identifier within parents system.

  • label – Friendly name or label within the parent.

  • relate – Child class instance for Homie Automate.

Returns:

Content related to the item in parent system.

class enhomie.philips.PhueDevice(homie: Homie, name: str, params: HomieChildParams)[source]#

Bases: HomieDevice

Contain the relevant attributes from the related source.

property family: Literal['philips']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

class enhomie.philips.PhueAction(member: HomieMember, origin: HomieOrigin)[source]#

Bases: HomieAction

Common methods and routines for Homie Automate threads.

execute(aitem: HomieActionItem) None[source]#

Perform the operation related to Homie service threads.

Parameters:

aitem – Item containing information for operation.

class enhomie.philips.PhueUpdate(*args: Any, **kwargs: Any)[source]#

Bases: HomieUpdate

Common methods and routines for Homie Automate threads.

class enhomie.philips.PhueStream(member: HomieMember, origin: HomieOrigin)[source]#

Bases: HomieStream

Common methods and routines for Homie Automate threads.

operate_streams() None[source]#

Perform the operation related to Homie service threads.

class enhomie.philips.PhueModels[source]#

Bases: object

Return the class object that was imported within method.

classmethod origin() Type[PhueOriginParams][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

classmethod action() Type[PhueActionItem][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

classmethod update() Type[PhueUpdateItem][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

classmethod stream() Type[PhueStreamItem][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

classmethod drivers() Type[PhueDriverModels][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

class enhomie.philips.DriverPhueButton(plugin: HomiePlugin, params: HomieParamsModel)[source]#

Bases: HomieDriver

Match specific conditions for determining desired state.

validate() None[source]#

Perform advanced validation on the parameters provided.

property family: Literal['philips']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kinds: list[HomiePluginKinds]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: DriverPhueButtonParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

occur(sitem: HomieStreamItem) bool[source]#

Return the boolean indicating the conditional outcomes.

Parameters:

sitem – Item containing information for operation.

Returns:

Boolean indicating the conditional outcomes.

class enhomie.philips.DriverPhueChange(plugin: HomiePlugin, params: HomieParamsModel)[source]#

Bases: HomieDriver

Match specific conditions for determining desired state.

validate() None[source]#

Perform advanced validation on the parameters provided.

property family: Literal['philips']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kinds: list[HomiePluginKinds]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: DriverPhueChangeParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

where(time: Time) bool[source]#

Return the boolean indicating the conditional outcomes.

Parameters:

time – Time that will be used in the conditionals.

Returns:

Boolean indicating the conditional outcomes.

class enhomie.philips.DriverPhueContact(plugin: HomiePlugin, params: HomieParamsModel)[source]#

Bases: HomieDriver

Match specific conditions for determining desired state.

validate() None[source]#

Perform advanced validation on the parameters provided.

property family: Literal['philips']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kinds: list[HomiePluginKinds]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: DriverPhueContactParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

occur(sitem: HomieStreamItem) bool[source]#

Return the boolean indicating the conditional outcomes.

Parameters:

sitem – Item containing information for operation.

Returns:

Boolean indicating the conditional outcomes.

class enhomie.philips.DriverPhueMotion(plugin: HomiePlugin, params: HomieParamsModel)[source]#

Bases: HomieDriver

Match specific conditions for determining desired state.

validate() None[source]#

Perform advanced validation on the parameters provided.

property family: Literal['philips']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kinds: list[HomiePluginKinds]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: DriverPhueMotionParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

occur(sitem: HomieStreamItem) bool[source]#

Return the boolean indicating the conditional outcomes.

Parameters:

sitem – Item containing information for operation.

Returns:

Boolean indicating the conditional outcomes.

class enhomie.philips.DriverPhueScene(plugin: HomiePlugin, params: HomieParamsModel)[source]#

Bases: HomieDriver

Match specific conditions for determining desired state.

validate() None[source]#

Perform advanced validation on the parameters provided.

property family: Literal['philips']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kinds: list[HomiePluginKinds]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: DriverPhueSceneParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

occur(sitem: HomieStreamItem) bool[source]#

Return the boolean indicating the conditional outcomes.

Parameters:

sitem – Item containing information for operation.

Returns:

Boolean indicating the conditional outcomes.

Philips Parameters#

class enhomie.philips.params.PhueOriginParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

bridge

BridgeParams

Yes

bridge: Annotated[BridgeParams, FieldInfo(annotation=NoneType, required=True, description='Connection specific parameters')]#
class enhomie.philips.params.DriverPhueButtonParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

device

str

Yes

min_length=1

events

list[Literal[‘initial_press’, ‘long_release’, ‘short_release’]] | None

No

None

min_length=1

sensor

Literal[‘button1’, ‘button2’, ‘button3’, ‘button4’]

Yes

device: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Device that is in scope', metadata=[MinLen(min_length=1)])]#
events: Annotated[list[Literal['initial_press', 'long_release', 'short_release']] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Events that will be matched', metadata=[MinLen(min_length=1)])]#
sensor: Annotated[Literal['button1', 'button2', 'button3', 'button4'], FieldInfo(annotation=NoneType, required=True, description='Sensor that will be matched')]#
class enhomie.philips.params.DriverPhueContactParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

device

str

Yes

min_length=1

states

list[Literal[‘contact’, ‘no_contact’]] | None

No

None

min_length=1

device: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Device that is in scope', metadata=[MinLen(min_length=1)])]#
states: Annotated[list[Literal['contact', 'no_contact']] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='States that will be matched', metadata=[MinLen(min_length=1)])]#
class enhomie.philips.params.DriverPhueMotionParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

device

str

Yes

min_length=1

states

list[Literal[‘motion’, ‘no_motion’]] | None

No

None

min_length=1

device: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Device that is in scope', metadata=[MinLen(min_length=1)])]#
states: Annotated[list[Literal['motion', 'no_motion']] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='States that will be matched', metadata=[MinLen(min_length=1)])]#
class enhomie.philips.params.DriverPhueChangeParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

devices

list[str]

Yes

min_length=1

sensors

list[Literal[‘button1’, ‘button2’, ‘button3’, ‘button4’, ‘contact’, ‘motion’, ‘temperature’]] | None

No

None

min_length=1

since

int

No

0

ge=0

devices: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='Devices that are in scope', metadata=[MinLen(min_length=1)])]#
sensors: Annotated[list[Literal['button1', 'button2', 'button3', 'button4', 'contact', 'motion', 'temperature']] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Sensors that will be matched', metadata=[MinLen(min_length=1)])]#
since: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=0, description='Minimum time since changed', metadata=[Ge(ge=0)])]#
class enhomie.philips.params.DriverPhueSceneParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

group

str

Yes

min_length=1

scene

str

Yes

min_length=1

states

list[Literal[‘active’, ‘inactive’]] | None

No

None

min_length=1

scene: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Scene that is in scope', metadata=[MinLen(min_length=1)])]#
group: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Group that is in scope', metadata=[MinLen(min_length=1)])]#
states: Annotated[list[Literal['active', 'inactive']] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='States that will be matched', metadata=[MinLen(min_length=1)])]#

Ubiquiti Support#

class enhomie.ubiquiti.UbiqOrigin(*args: Any, **kwargs: Any)[source]#

Bases: HomieOrigin

Contain the relevant attributes from the related source.

property family: Literal['ubiquiti']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property router: Router#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property fetch: dict[str, Any] | None#

Return the content related to the item in parent system.

Returns:

Content related to the item in parent system.

property merge: dict[str, dict[str, Any]] | None#

Return the content related to the item in parent system.

Returns:

Content related to the item in parent system.

refresh(timeout: int | None = None) bool[source]#

Refresh the cached information for the remote upstream.

Parameters:

timeout – Timeout waiting for the server response.

Returns:

Boolean indicating the success of the refresh.

get_update() HomieUpdateItem[source]#

Return the new item containing information for operation.

Returns:

New item containing information for operation.

set_update(uitem: HomieUpdateBase) bool[source]#

Replace or update internal configuration with provided.

Parameters:

uitem – Item containing information for operation.

Returns:

Boolean indicating whether or not was changed.

source(kind: HomieKinds | None = None, unique: str | None = None, label: str | None = None, relate: HomieActionNode | None = None) dict[str, Any] | None[source]#

Return the content related to the item in parent system.

Note

This method is redundant with other origin classes.

Parameters:
  • kind – Which kind of Homie object will be located.

  • unique – Unique identifier within parents system.

  • label – Friendly name or label within the parent.

  • relate – Child class instance for Homie Automate.

Returns:

Content related to the item in parent system.

class enhomie.ubiquiti.UbiqDevice(homie: Homie, name: str, params: HomieChildParams)[source]#

Bases: HomieDevice

Contain the relevant attributes from the related source.

property family: Literal['ubiquiti']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

class enhomie.ubiquiti.UbiqUpdate(*args: Any, **kwargs: Any)[source]#

Bases: HomieUpdate

Common methods and routines for Homie Automate threads.

class enhomie.ubiquiti.UbiqModels[source]#

Bases: object

Return the class object that was imported within method.

classmethod origin() Type[UbiqOriginParams][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

classmethod update() Type[UbiqUpdateItem][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

classmethod drivers() Type[UbiqDriverModels][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

class enhomie.ubiquiti.DriverUbiqClient(plugin: HomiePlugin, params: HomieParamsModel)[source]#

Bases: HomieDriver

Match specific conditions for determining desired state.

validate() None[source]#

Perform advanced validation on the parameters provided.

property family: Literal['ubiquiti']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kinds: list[HomiePluginKinds]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: DriverUbiqClientParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

where(time: Time) bool[source]#

Return the boolean indicating the conditional outcomes.

Parameters:

time – Time that will be used in the conditionals.

Returns:

Boolean indicating the conditional outcomes.

Ubiquiti Parameters#

class enhomie.ubiquiti.params.UbiqOriginParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

router

RouterParams

Yes

router: Annotated[RouterParams, FieldInfo(annotation=NoneType, required=True, description='Connection specific parameters')]#
class enhomie.ubiquiti.params.DriverUbiqClientParams[source]#

Bases: HomieParamsModel

Process and validate the Homie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

clients

list[str]

Yes

min_length=1

since

int

No

0

ge=0

clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='Clients that are in scope', metadata=[MinLen(min_length=1)])]#
since: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=0, description='Minimum time since changed', metadata=[Ge(ge=0)])]#

General Utilities#

exception enhomie.utils.InvalidChild(child: str | HomieChild, phase: Literal['initial', 'runtime'], about: str | None = None)[source]#

Bases: Exception

Exception for when the child could not be instantiated.

Note

Similar or identical to classes in other projects.

Parameters:
  • child – Name or child that is determined invalid.

  • phase – From which phase child was found invalid.

  • about – Additional information for the exception.

phase: Literal['initial', 'runtime']#
child: str#
about: str | None = None#
exception enhomie.utils.InvalidParam(error: Literal['minimal', 'invalid', 'missing', 'noexist'], about: str | None = None, *, child: HomieChild | None = None, param: str | None = None, value: Any | None = None)[source]#

Bases: Exception

Exception for after invalid parameters are encountered.

Note

Similar or identical to classes in other projects.

Parameters:
  • error – Simple code describing the invalid error.

  • about – Additional information for the exception.

  • child – Child class instance related to exception.

  • param – Name of the parameter which is not valid.

  • value – Value if any specified for the parameter.

error: Literal['minimal', 'invalid', 'missing', 'noexist']#
about: str | None = None#
child: HomieChild | None = None#
param: str | None = None#
value: Any | None = None#
exception enhomie.utils.Idempotent[source]#

Bases: Exception

Exception when action was not taken due to idempotency.

exception enhomie.utils.MultipleSource[source]#

Bases: Exception

Exception when multiple sources match given parameters.

class enhomie.utils.TestTimes(start: Time = Time('2026-05-21T05:00:00.000000+0000'), middle: Time = Time('2026-05-27T05:00:00.000000+0000'), final: Time = Time('2026-05-28T04:00:00.000000+0000'), current: Time = Time('2026-05-28T05:25:56.676254+0000'))[source]#

Bases: object

Contain the times used within various tests in project.

start: Time = Time('2026-05-21T05:00:00.000000+0000')#
middle: Time = Time('2026-05-27T05:00:00.000000+0000')#
final: Time = Time('2026-05-28T04:00:00.000000+0000')#
current: Time = Time('2026-05-28T05:25:56.676254+0000')#
class enhomie.utils.TestBodies(planets: tuple[Literal['jupiter', 'neptune'], ...] = ('jupiter', 'neptune'), moons: tuple[tuple[Literal['jupiter', 'neptune'], Literal['ganymede', 'halimede']], ...] = (('jupiter', 'ganymede'), ('neptune', 'halimede')))[source]#

Bases: object

Contain the planets used to reference test sample sets.

planets: tuple[Literal['jupiter', 'neptune'], ...] = ('jupiter', 'neptune')#
moons: tuple[tuple[Literal['jupiter', 'neptune'], Literal['ganymede', 'halimede']], ...] = (('jupiter', 'ganymede'), ('neptune', 'halimede'))#