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:
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.aspired.HomieAspiredItem(target: HomieActionNode, aspire: HomieAspire)[source]#
Bases:
objectContain information related to the aspired child state.
- aspire: HomieAspire#
- scene: HomieScene | 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:
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.desired.HomieDesiredItem(target: HomieActionNode, desire: HomieDesire)[source]#
Bases:
objectContain 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.
- desire: HomieDesire#
- property paused: bool#
Return the boolean indicating whether operation delayed.
- Returns:
Boolean indicating whether operation delayed.
- scene: HomieScene | None = None#
- target: HomieActionNode#
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.
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:
objectMethods 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.
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:
objectStore 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.
- 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.
- class enhomie.homie.addons.persist.HomiePersistRecord(record: HomiePersistTable | None = None, *, unique: Annotated[str, MinLen(min_length=1)], value: int | float | bool | str | None, value_unit: Annotated[str | None, MinLen(min_length=1)] = None, value_label: Annotated[str | None, MinLen(min_length=1)] = None, value_icon: Annotated[str | None, MinLen(min_length=1)] = None, about: Annotated[str | None, MinLen(min_length=1)] = None, about_label: Annotated[str | None, MinLen(min_length=1)] = None, about_icon: Annotated[str | None, MinLen(min_length=1)] = None, level: Annotated[Literal['failure', 'information', 'success', 'warning'] | None, MinLen(min_length=1)] = None, tags: Annotated[list[str] | None, MinLen(min_length=1)] = None, expire: Annotated[str | None, MinLen(min_length=20), MaxLen(max_length=32)] = None, update: Annotated[str, MinLen(min_length=20), MaxLen(max_length=32)])[source]#
Bases:
BaseModelContain the information regarding the persistent value.
- Parameters:
record – Record from the SQLAlchemy query routine.
kwargs – Keyword arguments passed for downstream.
- about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='About the 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)])]#
- about_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist entry', metadata=[MinLen(min_length=1)])]#
- expire: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='After when the key expires', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])]#
- 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)])]#
- model_config = {'extra': 'forbid'}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- tags: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Tags for persist entry', metadata=[MinLen(min_length=1)])]#
- unique: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Unique key for the value', metadata=[MinLen(min_length=1)])]#
- update: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='When the value was updated', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])]#
- value: Annotated[int | float | bool | str | None, FieldInfo(annotation=NoneType, required=True, description='Value stored at unique')]#
- value_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist value', metadata=[MinLen(min_length=1)])]#
- class enhomie.homie.addons.persist.HomiePersistTable(**kwargs)[source]#
Bases:
SQLBaseSchematic 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#
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.
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:
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.
- aspire: HomieAspire#
- scene: HomieScene | None = None#
- target: HomieActionNode#
- 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.
- property applied: bool#
Return the boolean indicating that there will be change.
- Returns:
Boolean indicating that there will be change.
- desire: HomieDesire#
- property paused: bool#
Return the boolean indicating whether operation delayed.
- Returns:
Boolean indicating whether operation delayed.
- scene: HomieScene | None = None#
- target: HomieActionNode#
- 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.HomieLogger(homie: Homie)[source]#
Bases:
objectMethods 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.
- 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.
- delete(unique: str) None[source]#
Delete the value within the persistent key value store.
- Parameters:
unique – Unique identifier from within 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.
- class enhomie.homie.addons.HomiePersistRecord(record: HomiePersistTable | None = None, *, unique: Annotated[str, MinLen(min_length=1)], value: int | float | bool | str | None, value_unit: Annotated[str | None, MinLen(min_length=1)] = None, value_label: Annotated[str | None, MinLen(min_length=1)] = None, value_icon: Annotated[str | None, MinLen(min_length=1)] = None, about: Annotated[str | None, MinLen(min_length=1)] = None, about_label: Annotated[str | None, MinLen(min_length=1)] = None, about_icon: Annotated[str | None, MinLen(min_length=1)] = None, level: Annotated[Literal['failure', 'information', 'success', 'warning'] | None, MinLen(min_length=1)] = None, tags: Annotated[list[str] | None, MinLen(min_length=1)] = None, expire: Annotated[str | None, MinLen(min_length=20), MaxLen(max_length=32)] = None, update: Annotated[str, MinLen(min_length=20), MaxLen(max_length=32)])[source]#
Bases:
BaseModelContain the information regarding the persistent value.
- Parameters:
record – Record from the SQLAlchemy query routine.
kwargs – Keyword arguments passed for downstream.
- about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='About the 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)])]#
- about_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist entry', metadata=[MinLen(min_length=1)])]#
- expire: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='After when the key expires', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])]#
- 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)])]#
- model_config = {'extra': 'forbid'}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- tags: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Tags for persist entry', metadata=[MinLen(min_length=1)])]#
- unique: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Unique key for the value', metadata=[MinLen(min_length=1)])]#
- update: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='When the value was updated', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])]#
- value: Annotated[int | float | bool | str | None, FieldInfo(annotation=NoneType, required=True, description='Value stored at unique')]#
- value_icon: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon for persist value', metadata=[MinLen(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.