enhomie.homie.threads package#

Submodules#

enhomie.homie.threads.action module#

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

Bases: HomieThreadItem

Contain information for sharing using the Python queue.

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

Bases: HomieThread

Common methods and routines for Homie Automate threads.

property member: HomieActions#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Homie service threads.

execute(aitem: HomieActionItem) None[source]#

Perform the operation related to Homie service threads.

Parameters:

aitem – Item containing information for operation.

enhomie.homie.threads.stream module#

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

Bases: HomieThreadItem

Contain information for sharing using the Python queue.

event: dict[str, Any]#
class enhomie.homie.threads.stream.HomieStream(member: HomieMember, origin: HomieOrigin)[source]#

Bases: HomieThread

Common methods and routines for Homie Automate threads.

property member: HomieStreams#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Homie service threads.

operate_streams() None[source]#

Perform the operation related to Homie service threads.

enhomie.homie.threads.thread module#

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

Bases: HomieQueueItem

Contain information for sharing using the Python queue.

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

Bases: Thread

Common methods and routines for Homie Automate threads.

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

  • origin – Child class instance for Homie Automate.

property homie: Homie#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property service: HomieService#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property member: HomieMember#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property origin: HomieOrigin#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property aqueue: HomieQueue[HomieActionItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property uqueue: HomieQueue[HomieUpdateItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property squeue: HomieQueue[HomieStreamItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

expired(item: HomieThreadItem) bool[source]#

Return the boolean indicating whether the item expired.

Parameters:

item – Item containing information for operation.

Returns:

Boolean indicating whether the item expired.

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

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

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

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

run() None[source]#

Perform whatever operation is associated with the class.

operate() None[source]#

Perform the operation related to Homie service threads.

operate_updates() None[source]#

Perform the operation related to Homie service threads.

stop() None[source]#

Wait for the thread object to complete routine and exit.

enhomie.homie.threads.update module#

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

Bases: HomieThreadItem

Contain information for sharing using the Python queue.

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

Bases: HomieThread

Common methods and routines for Homie Automate threads.

property member: HomieUpdates#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Homie service threads.

operate_updates() None[source]#

Perform the operation related to Homie service threads.

Module contents#

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

Bases: Thread

Common methods and routines for Homie Automate threads.

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

  • origin – Child class instance for Homie Automate.

property homie: Homie#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property service: HomieService#

Return the Homie instance to which the instance belongs.

Returns:

Homie instance to which the instance belongs.

property member: HomieMember#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property origin: HomieOrigin#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property aqueue: HomieQueue[HomieActionItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property uqueue: HomieQueue[HomieUpdateItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property squeue: HomieQueue[HomieStreamItem]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

expired(item: HomieThreadItem) bool[source]#

Return the boolean indicating whether the item expired.

Parameters:

item – Item containing information for operation.

Returns:

Boolean indicating whether the item expired.

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

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

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

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

run() None[source]#

Perform whatever operation is associated with the class.

operate() None[source]#

Perform the operation related to Homie service threads.

operate_updates() None[source]#

Perform the operation related to Homie service threads.

stop() None[source]#

Wait for the thread object to complete routine and exit.

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

Bases: HomieQueueItem

Contain information for sharing using the Python queue.

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

Bases: HomieThread

Common methods and routines for Homie Automate threads.

property member: HomieActions#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Homie service threads.

execute(aitem: HomieActionItem) None[source]#

Perform the operation related to Homie service threads.

Parameters:

aitem – Item containing information for operation.

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

Bases: HomieThreadItem

Contain information for sharing using the Python queue.

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

Bases: HomieThread

Common methods and routines for Homie Automate threads.

property member: HomieStreams#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Homie service threads.

operate_streams() None[source]#

Perform the operation related to Homie service threads.

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

Bases: HomieThreadItem

Contain information for sharing using the Python queue.

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

Bases: HomieThread

Common methods and routines for Homie Automate threads.

property member: HomieUpdates#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Homie service threads.

operate_updates() None[source]#

Perform the operation related to Homie service threads.

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

Bases: HomieThreadItem

Contain information for sharing using the Python queue.