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:
objectInteract 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:
ConfigContain 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.
- class enhomie.homie.HomieService(homie: Homie)[source]#
Bases:
objectMulti-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.
- 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.
Homie Parameters#
- class enhomie.homie.params.HomieParams[source]#
Bases:
ParamsProcess and validate the core configuration parameters.
Fields# Field
Type
Required
Default
Constraints
dict[str,HomieAspireParams] |NoneNo
Nonemin_length=1
No
FalseNo
'sqlite:///:memory:'min_length=1
No
Falsedict[str,HomieDesireParams] |NoneNo
Nonemin_length=1
dict[str,HomieDeviceParams] |NoneNo
Nonemin_length=1
No
FalseenconfigNo
NoneencryptsNo
NoneenloggerNo
NoneNo
factory
No
Truedict[str,HomieGroupParams] |NoneNo
Nonemin_length=1
dict[str,HomieOriginParams] |NoneNo
Nonemin_length=1
No
Nonemin_length=1
No
factory
No
factory
dict[str,HomieSceneParams] |NoneNo
Nonemin_length=1
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)])]#
- class enhomie.homie.params.HomiePrinterParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
No
FalseNo
FalseNo
FalseNo
FalseNo
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')]#
- class enhomie.homie.params.HomiePersistParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1, pattern=``re.compile(‘^(\d+(s|m|h|d|w|y))*$’)``
Literal[‘failure’, ‘information’, ‘success’, ‘warning’] |NoneNo
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_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)])]#
- class enhomie.homie.params.HomieOriginParams[source]#
Bases:
HomieChildParamsProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
No
NoneNo
NoneNo
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:
HomieChildParamsProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
Yes
min_length=1
No
Nonemin_length=1
- origin: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Origin where device exists', metadata=[MinLen(min_length=1)])]#
- class enhomie.homie.params.HomieGroupParams[source]#
Bases:
HomieChildParamsProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
- origin: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Origin where group exists', metadata=[MinLen(min_length=1)])]#
- class enhomie.homie.params.HomieSceneParams[source]#
Bases:
HomieChildParamsProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
dict[str,HomieStageParams] |NoneNo
Nonemin_length=1
No
Nonemin_length=1
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')]#
- class enhomie.homie.params.HomieAspireParams[source]#
Bases:
HomieChildParamsProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
No
3ge=1, le=86400
No
Nonemin_length=1
No
NoneNo
Nonemin_length=1
No
Nonemin_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)])]#
- class enhomie.homie.params.HomieDesireParams[source]#
Bases:
HomieChildParamsProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
TrueNo
Nonemin_length=1
No
Nonemin_length=1
No
0ge=0, le=86400
No
Nonemin_length=1
No
NoneNo
Nonemin_length=1
No
0ge=0, le=1000.0
No
Nonemin_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)])]#
- class enhomie.homie.params.HomieServiceParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
No
factory
No
factory
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:
HomieParamsModelProcess and validate the Homie configuration parameters.
- class enhomie.homie.params.HomieStoreParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
No
'1d'min_length=1, pattern=``re.compile(‘^(\d+(s|m|h|d|w|y))*$’)``
Literal[‘failure’, ‘information’, ‘success’, ‘warning’] |NoneNo
Nonemin_length=1
No
Nonemin_length=1
Yes
min_length=1
Yes
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_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)])]#
- class enhomie.homie.params.HomieOccurParams[source]#
Bases:
HomiePluginParamsProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
No
NoneNo
NoneNo
NoneNo
NoneNo
None- 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:
HomiePluginParamsProcess 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
No
NoneNo
NoneNo
'default'min_length=1
No
FalseNo
NoneNo
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:
objectParent 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.
- 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.
- class enhomie.homie.childs.HomieChilds(homie: Homie)[source]#
Bases:
objectContain the object instances for related Homie children.
- Parameters:
homie – Primary class instance for Homie Automate.
- 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:
HomieChildNormalize the desired parameters with multiple products.
- 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:
HomieChildNormalize the desired parameters with multiple products.
- 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.
- class enhomie.homie.childs.HomieGroup(homie: Homie, name: str, params: HomieChildParams)[source]#
Bases:
HomieChildNormalize the desired parameters with multiple products.
- 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.
- class enhomie.homie.childs.HomieScene(homie: Homie, name: str, params: HomieChildParams)[source]#
Bases:
HomieChildNormalize the desired parameters with multiple products.
- 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:
HomieChildMatch specific conditions for determining desired state.
- 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.
- class enhomie.homie.childs.HomieDesire(homie: Homie, name: str, params: HomieChildParams)[source]#
Bases:
HomieChildMatch specific conditions for determining desired state.
- 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.
Homie Add-ons#
- class enhomie.homie.addons.HomieLogger(homie: Homie)[source]#
Bases:
objectMethods for extending use of underlying logging library.
- Parameters:
homie – Primary class instance for Homie Automate.
- 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:
Jinja2Parse 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.
- class enhomie.homie.addons.HomieQueueItem[source]#
Bases:
objectContain information for sharing using the Python queue.
- class enhomie.homie.addons.HomieAspired(homie: Homie)[source]#
Bases:
objectContain 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:
objectContain information related to the aspired child state.
- target: HomieActionNode#
- aspire: HomieAspire#
- scene: HomieScene | None = None#
- class enhomie.homie.addons.HomieDesired(homie: Homie)[source]#
Bases:
objectContain 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:
objectContain information related to the desired child state.
- target: HomieActionNode#
- desire: HomieDesire#
- scene: HomieScene | None = None#
- property paused: bool#
Return the boolean indicating whether operation delayed.
- Returns:
Boolean indicating whether operation delayed.
- class enhomie.homie.addons.HomiePersist(homie: Homie)[source]#
Bases:
objectStore 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.
- 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:
BaseModelContain 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
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=20, max_length=32
Literal[‘failure’, ‘information’, ‘success’, ‘warning’] |NoneNo
Nonemin_length=1
No
Nonemin_length=1
Yes
min_length=1
Yes
min_length=20, max_length=32
Yes
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_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)])]#
Homie Members#
- class enhomie.homie.members.HomieMember(service: HomieService)[source]#
Bases:
objectCommon 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.
- 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:
HomieMemberCommon methods and routines for Homie Automate 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:
HomieMemberCommon methods and routines for Homie Automate 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:
HomieMemberCommon methods and routines for Homie Automate 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:
HomieMemberCommon 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.
- 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:
ThreadCommon 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.
- class enhomie.homie.threads.HomieThreadItem(origin: HomieOrigin)[source]#
Bases:
HomieQueueItemContain information for sharing using the Python queue.
- class enhomie.homie.threads.HomieAction(member: HomieMember, origin: HomieOrigin)[source]#
Bases:
HomieThreadCommon 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.
- 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:
HomieThreadItemContain information for sharing using the Python queue.
- class enhomie.homie.threads.HomieStream(member: HomieMember, origin: HomieOrigin)[source]#
Bases:
HomieThreadCommon 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.
- class enhomie.homie.threads.HomieStreamItem(origin: HomieOrigin, event: dict[str, Any])[source]#
Bases:
HomieThreadItemContain information for sharing using the Python queue.
- class enhomie.homie.threads.HomieUpdate(*args: Any, **kwargs: Any)[source]#
Bases:
HomieThreadCommon 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.
- class enhomie.homie.threads.HomieUpdateItem(origin: HomieOrigin)[source]#
Bases:
HomieThreadItemContain information for sharing using the Python queue.
Homie Plugins#
- class enhomie.homie.plugins.HomiePlugin(homie: Homie, params: HomiePluginParams)[source]#
Bases:
objectMatch specific conditions for determining desired state.
- Parameters:
homie – Primary class instance for Homie Automate.
params – Parameters used to instantiate the class.
- 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.
- class enhomie.homie.plugins.HomieWhere(homie: Homie, params: HomiePluginParams)[source]#
Bases:
HomiePluginMatch specific conditions for determining desired state.
- 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.
- class enhomie.homie.plugins.HomieOccur(homie: Homie, params: HomiePluginParams)[source]#
Bases:
HomiePluginMatch specific conditions for determining desired state.
- 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:
objectMatch specific conditions for determining desired state.
- Parameters:
plugin – Plugin class instance for Homie Automate.
params – Parameters used to instantiate the class.
- 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.
Homie RESTful#
- class enhomie.restful.RestfulService(homie: Homie)[source]#
Bases:
objectApplication 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.
- class enhomie.restful.RestfulServiceParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
'127.0.0.1'min_length=1
No
8420ge=0, le=65535
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_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)])]#
Homie Examples#
Origins#
---
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:
####################
## 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:
####################
## 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:
####################
## 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:
############
## 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 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 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 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 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:
#####################
## 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:
#####################
## 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:
#####################
## 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:
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:
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:
HomieOriginContain 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:
HomieDeviceContain the relevant attributes from the related source.
- class enhomie.hubitat.HubiAction(member: HomieMember, origin: HomieOrigin)[source]#
Bases:
HomieActionCommon 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:
HomieUpdateCommon methods and routines for Homie Automate threads.
- class enhomie.hubitat.HubiModels[source]#
Bases:
objectReturn 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:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
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:
HomieOriginContain 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:
HomieDeviceContain the relevant attributes from the related source.
- class enhomie.philips.PhueAction(member: HomieMember, origin: HomieOrigin)[source]#
Bases:
HomieActionCommon 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:
HomieUpdateCommon methods and routines for Homie Automate threads.
- class enhomie.philips.PhueStream(member: HomieMember, origin: HomieOrigin)[source]#
Bases:
HomieStreamCommon methods and routines for Homie Automate threads.
- class enhomie.philips.PhueModels[source]#
Bases:
objectReturn 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:
HomieDriverMatch specific conditions for determining desired state.
- 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:
HomieDriverMatch specific conditions for determining desired state.
- 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.
- class enhomie.philips.DriverPhueContact(plugin: HomiePlugin, params: HomieParamsModel)[source]#
Bases:
HomieDriverMatch specific conditions for determining desired state.
- 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:
HomieDriverMatch specific conditions for determining desired state.
- 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:
HomieDriverMatch specific conditions for determining desired state.
- 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:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Yes
- bridge: Annotated[BridgeParams, FieldInfo(annotation=NoneType, required=True, description='Connection specific parameters')]#
- class enhomie.philips.params.DriverPhueButtonParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
list[Literal[‘initial_press’, ‘long_release’, ‘short_release’]] |NoneNo
Nonemin_length=1
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)])]#
- class enhomie.philips.params.DriverPhueContactParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
No
Nonemin_length=1
- class enhomie.philips.params.DriverPhueMotionParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
No
Nonemin_length=1
- class enhomie.philips.params.DriverPhueChangeParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
list[Literal[‘button1’, ‘button2’, ‘button3’, ‘button4’, ‘contact’, ‘motion’, ‘temperature’]] |NoneNo
Nonemin_length=1
No
0ge=0
- devices: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='Devices that are in scope', metadata=[MinLen(min_length=1)])]#
- class enhomie.philips.params.DriverPhueSceneParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
Yes
min_length=1
No
Nonemin_length=1
- scene: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Scene that is in scope', metadata=[MinLen(min_length=1)])]#
Ubiquiti Support#
- class enhomie.ubiquiti.UbiqOrigin(*args: Any, **kwargs: Any)[source]#
Bases:
HomieOriginContain 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:
HomieDeviceContain the relevant attributes from the related source.
- class enhomie.ubiquiti.UbiqUpdate(*args: Any, **kwargs: Any)[source]#
Bases:
HomieUpdateCommon methods and routines for Homie Automate threads.
- class enhomie.ubiquiti.UbiqModels[source]#
Bases:
objectReturn 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:
HomieDriverMatch specific conditions for determining desired state.
- 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.
Ubiquiti Parameters#
- class enhomie.ubiquiti.params.UbiqOriginParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Yes
- router: Annotated[RouterParams, FieldInfo(annotation=NoneType, required=True, description='Connection specific parameters')]#
- class enhomie.ubiquiti.params.DriverUbiqClientParams[source]#
Bases:
HomieParamsModelProcess and validate the Homie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
No
0ge=0
General Utilities#
- exception enhomie.utils.InvalidChild(child: str | HomieChild, phase: Literal['initial', 'runtime'], about: str | None = None)[source]#
Bases:
ExceptionException 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.
- 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:
ExceptionException 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.
- child: HomieChild | None = None#
- exception enhomie.utils.Idempotent[source]#
Bases:
ExceptionException when action was not taken due to idempotency.
- exception enhomie.utils.MultipleSource[source]#
Bases:
ExceptionException 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:
objectContain the times used within various tests in project.
- 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:
objectContain the planets used to reference test sample sets.