enhomie.homie.addons package#

Subpackages#

Submodules#

enhomie.homie.addons.aspired 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.homie.addons.aspired.HomieAspired(homie: Homie)[source]#

Bases: object

Contain information related to the aspired child state.

Parameters:

homie – Primary class instance for Homie Automate.

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

Return the action state objects for the related targets.

..note::

Somewhat similar to same method within HomieDesire.

Parameters:

sitem – Item containing information for operation.

Returns:

Action state objects for the related targets.

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

Bases: object

Contain information related to the aspired child state.

aspire: HomieAspire#
color: str | None = None#
level: int | None = None#
scene: HomieScene | None = None#
state: HomieState | None = None#
target: HomieActionNode#

enhomie.homie.addons.desired 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.homie.addons.desired.HomieDesired(homie: Homie)[source]#

Bases: object

Contain information related to the desired child state.

Parameters:

homie – Primary class instance for Homie Automate.

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

Return the action state objects for the related targets.

..note::

Somewhat similar to same method within HomieAspire.

Parameters:

time – Time that will be used in the conditionals.

Returns:

Action state objects for the related targets.

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

Bases: object

Contain information related to the desired child state.

property applied: bool#

Return the boolean indicating that there will be change.

Returns:

Boolean indicating that there will be change.

color: str | None = None#
desire: HomieDesire#
level: int | None = None#
matched() None[source]#

Perform operations when this desire is the most desired.

omitted() None[source]#

Perform operations when this desire is the most desired.

property paused: bool#

Return the boolean indicating whether operation delayed.

Returns:

Boolean indicating whether operation delayed.

scene: HomieScene | None = None#
state: HomieState | None = None#
target: HomieActionNode#
weight: int#

enhomie.homie.addons.jinja2 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.homie.addons.jinja2.HomieJinja2(homie: Homie)[source]#

Bases: Jinja2

Parse the provided input and intelligently return value.

Parameters:

homie – Primary class instance for Homie Automate.

enhomie.homie.addons.logger 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.homie.addons.logger.HomieLogger(homie: Homie)[source]#

Bases: object

Methods for extending use of underlying logging library.

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.

start() None[source]#

Initialize the Python logging library using parameters.

stop() None[source]#

Deinitialize the Python logging library using parameters.

enhomie.homie.addons.persist 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.homie.addons.persist.HomiePersist(homie: Homie)[source]#

Bases: object

Store the persistent information in the key value store.

Parameters:

homie – Primary class instance for Homie Automate.

delete(unique: str) None[source]#

Delete the value within the persistent key value store.

Parameters:

unique – Unique identifier from within the table.

expire() None[source]#

Remove the expired persistent key values from the table.

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.

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.

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.

pydantic model enhomie.homie.addons.persist.HomiePersistRecord[source]#

Bases: BaseModel

Contain the information regarding the persistent value.

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

  • kwargs – Keyword arguments passed for downstream.

Show JSON schema
{
   "title": "HomiePersistRecord",
   "description": "Contain the information regarding the persistent value.\n\n:param record: Record from the SQLAlchemy query routine.\n:param kwargs: Keyword arguments passed for downstream.",
   "type": "object",
   "properties": {
      "unique": {
         "description": "Unique key for the value",
         "minLength": 1,
         "title": "Unique",
         "type": "string"
      },
      "value": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "number"
            },
            {
               "type": "boolean"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "description": "Value stored at unique",
         "title": "Value"
      },
      "value_unit": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Unit for persist value",
         "title": "Value Unit"
      },
      "value_label": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Label for persist value",
         "title": "Value Label"
      },
      "value_icon": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Icon for persist value",
         "title": "Value Icon"
      },
      "about": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "About the persist entry",
         "title": "About"
      },
      "about_label": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Label for persist entry",
         "title": "About Label"
      },
      "about_icon": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Icon for persist entry",
         "title": "About Icon"
      },
      "level": {
         "anyOf": [
            {
               "enum": [
                  "failure",
                  "information",
                  "success",
                  "warning"
               ],
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Severity of persist entry",
         "title": "Level"
      },
      "tags": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "minItems": 1,
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Tags for persist entry",
         "title": "Tags"
      },
      "expire": {
         "anyOf": [
            {
               "maxLength": 32,
               "minLength": 20,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "After when the key expires",
         "title": "Expire"
      },
      "update": {
         "description": "When the value was updated",
         "maxLength": 32,
         "minLength": 20,
         "title": "Update",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "unique",
      "value",
      "update"
   ]
}

Config:
  • extra: str = forbid

Fields:
field about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='About the persist entry', metadata=[MinLen(min_length=1)])] = None#

About the persist entry

Constraints:
  • min_length = 1

field about_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist entry', metadata=[MinLen(min_length=1)])] = None#

Icon for persist entry

Constraints:
  • min_length = 1

field about_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist entry', metadata=[MinLen(min_length=1)])] = None#

Label for persist entry

Constraints:
  • min_length = 1

field expire: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='After when the key expires', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])] = None#

After when the key expires

Constraints:
  • min_length = 20

  • max_length = 32

field 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)])] = None#

Severity of persist entry

Constraints:
  • min_length = 1

field tags: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Tags for persist entry', metadata=[MinLen(min_length=1)])] = None#

Tags for persist entry

Constraints:
  • min_length = 1

field unique: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Unique key for the value', metadata=[MinLen(min_length=1)])] [Required]#

Unique key for the value

Constraints:
  • min_length = 1

field update: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='When the value was updated', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])] [Required]#

When the value was updated

Constraints:
  • min_length = 20

  • max_length = 32

field value: Annotated[int | float | bool | str | None, FieldInfo(annotation=NoneType, required=True, description='Value stored at unique')] [Required]#

Value stored at unique

field value_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist value', metadata=[MinLen(min_length=1)])] = None#

Icon for persist value

Constraints:
  • min_length = 1

field value_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist value', metadata=[MinLen(min_length=1)])] = None#

Label for persist value

Constraints:
  • min_length = 1

field value_unit: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Unit for persist value', metadata=[MinLen(min_length=1)])] = None#

Unit for persist value

Constraints:
  • min_length = 1

class enhomie.homie.addons.persist.HomiePersistTable(**kwargs)[source]#

Bases: SQLBase

Schematic for the database operations using SQLAlchemy.

Note

Fields are not completely documented for this model.

about#
about_icon#
about_label#
expire#
level#
tags#
unique#
update#
value#
value_icon#
value_label#
value_unit#
class enhomie.homie.addons.persist.SQLBase(**kwargs: Any)[source]#

Bases: DeclarativeBase

Some additional class that SQLAlchemy requires to work.

metadata: ClassVar[MetaData] = MetaData()#

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>#

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

enhomie.homie.addons.queue 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.homie.addons.queue.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.

get() HomieQueueItemType[source]#

Return the next item within the queue in blocking mode.

Returns:

Next item within the queue in blocking mode.

put(item: HomieQueueItemType) None[source]#

Store the provided item within the queue class instance.

Parameters:

item – Item containing information for operation.

property qsize: int#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

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

Bases: object

Contain information for sharing using the Python queue.

time: Time#

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.homie.addons.HomieAspired(homie: Homie)[source]#

Bases: object

Contain information related to the aspired child state.

Parameters:

homie – Primary class instance for Homie Automate.

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

Return the action state objects for the related targets.

..note::

Somewhat similar to same method within HomieDesire.

Parameters:

sitem – Item containing information for operation.

Returns:

Action state objects for the related targets.

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

Bases: object

Contain information related to the aspired child state.

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

Bases: object

Contain information related to the desired child state.

Parameters:

homie – Primary class instance for Homie Automate.

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

Return the action state objects for the related targets.

..note::

Somewhat similar to same method within HomieAspire.

Parameters:

time – Time that will be used in the conditionals.

Returns:

Action state objects for the related targets.

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

Bases: object

Contain information related to the desired child state.

property applied: bool#

Return the boolean indicating that there will be change.

Returns:

Boolean indicating that there will be change.

color: str | None = None#
desire: HomieDesire#
level: int | None = None#
matched() None[source]#

Perform operations when this desire is the most desired.

omitted() None[source]#

Perform operations when this desire is the most desired.

property paused: bool#

Return the boolean indicating whether operation delayed.

Returns:

Boolean indicating whether operation delayed.

scene: HomieScene | None = None#
state: HomieState | None = None#
target: HomieActionNode#
weight: int#
class enhomie.homie.addons.HomieJinja2(homie: Homie)[source]#

Bases: Jinja2

Parse the provided input and intelligently return value.

Parameters:

homie – Primary class instance for Homie Automate.

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

Bases: object

Methods for extending use of underlying logging library.

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.

start() None[source]#

Initialize the Python logging library using parameters.

stop() None[source]#

Deinitialize the Python logging library using parameters.

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

Bases: object

Store the persistent information in the key value store.

Parameters:

homie – Primary class instance for Homie Automate.

delete(unique: str) None[source]#

Delete the value within the persistent key value store.

Parameters:

unique – Unique identifier from within the table.

expire() None[source]#

Remove the expired persistent key values from the table.

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.

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.

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.

pydantic model enhomie.homie.addons.HomiePersistRecord[source]#

Bases: BaseModel

Contain the information regarding the persistent value.

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

  • kwargs – Keyword arguments passed for downstream.

Show JSON schema
{
   "title": "HomiePersistRecord",
   "description": "Contain the information regarding the persistent value.\n\n:param record: Record from the SQLAlchemy query routine.\n:param kwargs: Keyword arguments passed for downstream.",
   "type": "object",
   "properties": {
      "unique": {
         "description": "Unique key for the value",
         "minLength": 1,
         "title": "Unique",
         "type": "string"
      },
      "value": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "number"
            },
            {
               "type": "boolean"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "description": "Value stored at unique",
         "title": "Value"
      },
      "value_unit": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Unit for persist value",
         "title": "Value Unit"
      },
      "value_label": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Label for persist value",
         "title": "Value Label"
      },
      "value_icon": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Icon for persist value",
         "title": "Value Icon"
      },
      "about": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "About the persist entry",
         "title": "About"
      },
      "about_label": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Label for persist entry",
         "title": "About Label"
      },
      "about_icon": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Icon for persist entry",
         "title": "About Icon"
      },
      "level": {
         "anyOf": [
            {
               "enum": [
                  "failure",
                  "information",
                  "success",
                  "warning"
               ],
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Severity of persist entry",
         "title": "Level"
      },
      "tags": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "minItems": 1,
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Tags for persist entry",
         "title": "Tags"
      },
      "expire": {
         "anyOf": [
            {
               "maxLength": 32,
               "minLength": 20,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "After when the key expires",
         "title": "Expire"
      },
      "update": {
         "description": "When the value was updated",
         "maxLength": 32,
         "minLength": 20,
         "title": "Update",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "unique",
      "value",
      "update"
   ]
}

Config:
  • extra: str = forbid

Fields:
field about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='About the persist entry', metadata=[MinLen(min_length=1)])] = None#

About the persist entry

Constraints:
  • min_length = 1

field about_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist entry', metadata=[MinLen(min_length=1)])] = None#

Icon for persist entry

Constraints:
  • min_length = 1

field about_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist entry', metadata=[MinLen(min_length=1)])] = None#

Label for persist entry

Constraints:
  • min_length = 1

field expire: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='After when the key expires', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])] = None#

After when the key expires

Constraints:
  • min_length = 20

  • max_length = 32

field 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)])] = None#

Severity of persist entry

Constraints:
  • min_length = 1

field tags: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Tags for persist entry', metadata=[MinLen(min_length=1)])] = None#

Tags for persist entry

Constraints:
  • min_length = 1

field unique: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Unique key for the value', metadata=[MinLen(min_length=1)])] [Required]#

Unique key for the value

Constraints:
  • min_length = 1

field update: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='When the value was updated', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])] [Required]#

When the value was updated

Constraints:
  • min_length = 20

  • max_length = 32

field value: Annotated[int | float | bool | str | None, FieldInfo(annotation=NoneType, required=True, description='Value stored at unique')] [Required]#

Value stored at unique

field value_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist value', metadata=[MinLen(min_length=1)])] = None#

Icon for persist value

Constraints:
  • min_length = 1

field value_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist value', metadata=[MinLen(min_length=1)])] = None#

Label for persist value

Constraints:
  • min_length = 1

field value_unit: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Unit for persist value', metadata=[MinLen(min_length=1)])] = None#

Unit for persist value

Constraints:
  • min_length = 1

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.

get() HomieQueueItemType[source]#

Return the next item within the queue in blocking mode.

Returns:

Next item within the queue in blocking mode.

put(item: HomieQueueItemType) None[source]#

Store the provided item within the queue class instance.

Parameters:

item – Item containing information for operation.

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: object

Contain information for sharing using the Python queue.

time: Time#