enhomie.hubitat package#

Subpackages#

Submodules#

enhomie.hubitat.action module#

Functions and routines associated with Enasis Network Homie Automate.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enhomie.hubitat.action.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.action.HubiActionItem(*args: Any, **kwargs: Any)[source]#

Bases: HomieActionItem

Contain information for sharing using the Python queue.

enhomie.hubitat.device module#

Functions and routines associated with Enasis Network Homie Automate.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enhomie.hubitat.device.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.

enhomie.hubitat.helpers module#

Functions and routines associated with Enasis Network Homie Automate.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

enhomie.hubitat.helpers.action_request(origin: HubiOrigin, unique: str, *, property: Literal['state', 'color', 'level'], value: Literal['on', 'off'] | int | Color | None = None, force: bool = False, change: bool = True, timeout: int | None = None) Response | Literal[True] | None[source]#

Request to execute the action on target from the bridge.

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

  • type – Which type of target to perform the action.

  • unique – Unique identifier within parents system.

  • property – What attribute on the target is change.

  • value – Value relating to property being updated.

  • force – Override the default for full idempotency.

  • change – Determine whether the change is executed.

  • timeout – Timeout waiting for the server response.

Returns:

Response from upstream request to the server.

enhomie.hubitat.helpers.merge_fetch(fetch: list[dict[str, Any]]) dict[str, dict[str, Any]][source]#

Return the content related to the item in parent system.

Parameters:

fetch – Dictionary from the origin to be updated.

Returns:

Content related to the item in parent system.

enhomie.hubitat.helpers.merge_find(merge: dict[str, dict[str, Any]], kind: HomieKinds | None = None, unique: str | None = None, label: str | None = None) list[dict[str, Any]][source]#

Return the content related to the item in parent system.

Parameters:
  • merge – Dictionary from the origin to be updated.

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

  • unique – Unique identifier within parents system.

  • label – Friendly name or label within the parent.

Returns:

Content related to the item in parent system.

enhomie.hubitat.helpers.request_action(origin: HubiOrigin, target: HomieActionNode, *, state: HomieState | None = None, color: str | Color | None = None, level: int | None = None, scene: HomieScene | None = None, force: bool = False, change: bool = True, timeout: int | None = None) None[source]#

Perform the provided action with specified Homie target.

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

  • 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.

  • timeout – Timeout waiting for the server response.

enhomie.hubitat.models module#

Functions and routines associated with Enasis Network Homie Automate.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enhomie.hubitat.models.HubiModels[source]#

Bases: object

Return the 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 origin() Type[HubiOriginParams][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.

enhomie.hubitat.origin module#

Functions and routines associated with Enasis Network Homie Automate.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

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

Bases: HomieOrigin

Contain the relevant attributes from the related source.

property bridge: Bridge#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property family: Literal['hubitat']#

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.

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.

get_update() HomieUpdateItem[source]#

Return the new item containing information for operation.

Returns:

New item containing information for operation.

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.

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.

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.

enhomie.hubitat.update module#

Functions and routines associated with Enasis Network Homie Automate.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

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

Bases: HomieUpdate

Common methods and routines for Homie Automate threads.

class enhomie.hubitat.update.HubiUpdateItem(origin: HomieOrigin, fetch: list[dict[str, Any]])[source]#

Bases: HomieUpdateItem

Contain information for sharing using the Python queue.

fetch: list[dict[str, Any]]#

Module contents#

Functions and routines associated with Enasis Network Homie Automate.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

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.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.HubiModels[source]#

Bases: object

Return the 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 origin() Type[HubiOriginParams][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.

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

Bases: HomieOrigin

Contain the relevant attributes from the related source.

property bridge: Bridge#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property family: Literal['hubitat']#

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.

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.

get_update() HomieUpdateItem[source]#

Return the new item containing information for operation.

Returns:

New item containing information for operation.

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.

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.

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.HubiUpdate(*args: Any, **kwargs: Any)[source]#

Bases: HomieUpdate

Common methods and routines for Homie Automate threads.