enhomie.homie package#
Subpackages#
- enhomie.homie.addons package
- Subpackages
- Submodules
- enhomie.homie.addons.aspired module
- enhomie.homie.addons.desired module
- enhomie.homie.addons.jinja2 module
- enhomie.homie.addons.logger module
- enhomie.homie.addons.persist module
HomiePersist
HomiePersistRecord
HomiePersistRecord.about
HomiePersistRecord.about_icon
HomiePersistRecord.about_label
HomiePersistRecord.expire
HomiePersistRecord.level
HomiePersistRecord.tags
HomiePersistRecord.unique
HomiePersistRecord.update
HomiePersistRecord.value
HomiePersistRecord.value_icon
HomiePersistRecord.value_label
HomiePersistRecord.value_unit
HomiePersistTable
HomiePersistTable.about
HomiePersistTable.about_icon
HomiePersistTable.about_label
HomiePersistTable.expire
HomiePersistTable.level
HomiePersistTable.tags
HomiePersistTable.unique
HomiePersistTable.update
HomiePersistTable.value
HomiePersistTable.value_icon
HomiePersistTable.value_label
HomiePersistTable.value_unit
SQLBase
- enhomie.homie.addons.queue module
- Module contents
HomieAspired
HomieAspiredItem
HomieDesired
HomieDesiredItem
HomieJinja2
HomieLogger
HomiePersist
HomiePersistRecord
HomiePersistRecord.about
HomiePersistRecord.about_icon
HomiePersistRecord.about_label
HomiePersistRecord.expire
HomiePersistRecord.level
HomiePersistRecord.tags
HomiePersistRecord.unique
HomiePersistRecord.update
HomiePersistRecord.value
HomiePersistRecord.value_icon
HomiePersistRecord.value_label
HomiePersistRecord.value_unit
HomieQueue
HomieQueueItem
- enhomie.homie.childs package
- Subpackages
- enhomie.homie.childs.test package
- Submodules
- enhomie.homie.childs.test.test_aspire module
- enhomie.homie.childs.test.test_child module
- enhomie.homie.childs.test.test_desire module
- enhomie.homie.childs.test.test_device module
- enhomie.homie.childs.test.test_group module
- enhomie.homie.childs.test.test_homie module
- enhomie.homie.childs.test.test_origin module
- enhomie.homie.childs.test.test_scene module
- Module contents
- enhomie.homie.childs.test package
- Submodules
- enhomie.homie.childs.aspire module
- enhomie.homie.childs.child module
- enhomie.homie.childs.desire module
- enhomie.homie.childs.device module
- enhomie.homie.childs.group module
- enhomie.homie.childs.helpers module
- enhomie.homie.childs.homie module
- enhomie.homie.childs.origin module
HomieOrigin
HomieOrigin.dumped
HomieOrigin.family
HomieOrigin.get_action()
HomieOrigin.get_stream()
HomieOrigin.get_update()
HomieOrigin.kind
HomieOrigin.params
HomieOrigin.put_action()
HomieOrigin.put_stream()
HomieOrigin.put_update()
HomieOrigin.refresh()
HomieOrigin.set_action()
HomieOrigin.set_update()
HomieOrigin.source()
HomieOrigin.validate()
- enhomie.homie.childs.scene module
- Module contents
HomieAspire
HomieChild
HomieChilds
HomieDesire
HomieDevice
HomieGroup
HomieOrigin
HomieOrigin.dumped
HomieOrigin.family
HomieOrigin.get_action()
HomieOrigin.get_stream()
HomieOrigin.get_update()
HomieOrigin.kind
HomieOrigin.params
HomieOrigin.put_action()
HomieOrigin.put_stream()
HomieOrigin.put_update()
HomieOrigin.refresh()
HomieOrigin.set_action()
HomieOrigin.set_update()
HomieOrigin.source()
HomieOrigin.validate()
HomieScene
- Subpackages
- enhomie.homie.members package
- Subpackages
- Submodules
- enhomie.homie.members.actions module
- enhomie.homie.members.member module
HomieMember
HomieMember.aqueue
HomieMember.cancel
HomieMember.congest
HomieMember.enqueue
HomieMember.get_thread()
HomieMember.homie
HomieMember.operate()
HomieMember.operate_updates()
HomieMember.running
HomieMember.service
HomieMember.soft()
HomieMember.squeue
HomieMember.start()
HomieMember.stop()
HomieMember.threads
HomieMember.uqueue
HomieMember.vacate
HomieMember.zombies
- enhomie.homie.members.restful module
- enhomie.homie.members.streams module
- enhomie.homie.members.updates module
- Module contents
HomieActions
HomieMember
HomieMember.aqueue
HomieMember.cancel
HomieMember.congest
HomieMember.enqueue
HomieMember.get_thread()
HomieMember.homie
HomieMember.operate()
HomieMember.operate_updates()
HomieMember.running
HomieMember.service
HomieMember.soft()
HomieMember.squeue
HomieMember.start()
HomieMember.stop()
HomieMember.threads
HomieMember.uqueue
HomieMember.vacate
HomieMember.zombies
HomieRestful
HomieStreams
HomieUpdates
- enhomie.homie.params package
- Submodules
- enhomie.homie.params.aspire module
- enhomie.homie.params.child module
- enhomie.homie.params.common module
- enhomie.homie.params.desire module
- enhomie.homie.params.device module
- enhomie.homie.params.group module
- enhomie.homie.params.homie module
- enhomie.homie.params.occur module
- enhomie.homie.params.origin module
- enhomie.homie.params.persist module
- enhomie.homie.params.plugin module
- enhomie.homie.params.scene module
- enhomie.homie.params.service module
- enhomie.homie.params.stage module
- enhomie.homie.params.store module
- enhomie.homie.params.where module
- Module contents
HomieAspireParams
HomieChildParams
HomieDesireParams
HomieDeviceParams
HomieGroupParams
HomieOccurParams
HomieOriginParams
HomieParams
HomieParams.aspires
HomieParams.database
HomieParams.desires
HomieParams.devices
HomieParams.dryrun
HomieParams.enconfig
HomieParams.encrypts
HomieParams.enlogger
HomieParams.filters
HomieParams.groups
HomieParams.origins
HomieParams.persists
HomieParams.potent
HomieParams.printer
HomieParams.restful
HomieParams.scenes
HomieParams.service
HomieParamsModel
HomiePersistParams
HomiePluginParams
HomiePrinterParams
HomieSceneParams
HomieServiceParams
HomieStoreParams
HomieWhereParams
- enhomie.homie.plugins package
- enhomie.homie.test package
- enhomie.homie.threads package
- Subpackages
- Submodules
- enhomie.homie.threads.action module
- enhomie.homie.threads.stream module
- enhomie.homie.threads.thread module
- enhomie.homie.threads.update module
- Module contents
Submodules#
enhomie.homie.common 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.config 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.config.HomieConfig(sargs: dict[str, Any] | None = None, files: str | Path | list[str | Path] | tuple[str | Path] | set[str] | None = None, cargs: dict[str, Any] | None = None)[source]#
Bases:
Config
Contain 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.
enhomie.homie.homie 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.homie.Homie(config: HomieConfig)[source]#
Bases:
object
Interact with supported devices to ensure desired state.
- Parameters:
config – Primary class instance for configuration.
- property aspired: HomieAspired#
Return the related desired state for the desired groups.
- Returns:
Related desired state for the desired groups.
- property childs: HomieChilds#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property config: HomieConfig#
Return the Config instance containing the configuration.
- Returns:
Config instance containing the configuration.
- property desired: HomieDesired#
Return the related actions matching the provided event.
- Returns:
Related actions matching the provided event.
- property dryrun: bool#
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_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.
- 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.
- property jinja2: HomieJinja2#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property logger: HomieLogger#
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 persist: HomiePersist#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property potent: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class 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.
- 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_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.
enhomie.homie.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.homie.models.HomieModels[source]#
Bases:
object
Return the class object that was imported within method.
- classmethod action() Type[HomieActionItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod aspire() Type[HomieAspireParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod aspired() Type[HomieAspiredItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod builtins() Type[BltnModels] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod child() Type[HomieChildParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod desire() Type[HomieDesireParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod desired() Type[HomieDesiredItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod device() Type[HomieDeviceParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod group() Type[HomieGroupParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod homie() Type[HomieParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod hubitat() Type[HubiModels] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod occur() Type[HomieOccurParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod origin() Type[HomieOriginParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod philips() Type[PhueModels] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod plugin() Type[HomiePluginParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod printer() Type[HomiePrinterParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod queue() Type[HomieQueueItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod scene() Type[HomieSceneParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod service() Type[HomieServiceParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod stage() Type[HomieStage] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod stream() Type[HomieStreamItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod thread() Type[HomieThreadItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod ubiquiti() Type[UbiqModels] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod update() Type[HomieUpdateItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod where() Type[HomieWhereParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
enhomie.homie.service 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.service.HomieService(homie: Homie)[source]#
Bases:
object
Multi-threaded service for processing the desired state.
- Parameters:
homie – Primary class instance for Homie Automate.
- property actions: HomieActions | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- check_congest() bool [source]#
Return the boolean indicating when queues are congested.
- Returns:
Boolean indicating when queues are congested.
- check_zombies() bool [source]#
Return the boolean indicating while threads are zombies.
- Returns:
Boolean indicating while threads are 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.
- 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 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.
- soft(*args: Any, **kwargs: Any) None [source]#
Stop the various threads within the Homie class object.
- Parameters:
kwargs – Keyword arguments ignored by the method.
args – Positional arguments ignored by the method.
- stop(*args: Any, **kwargs: Any) None [source]#
Stop the various threads within the Homie class object.
- Parameters:
kwargs – Keyword arguments ignored by the method.
args – Positional arguments ignored by the method.
- property streams: HomieStreams | 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.
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.Homie(config: HomieConfig)[source]#
Bases:
object
Interact with supported devices to ensure desired state.
- Parameters:
config – Primary class instance for configuration.
- property aspired: HomieAspired#
Return the related desired state for the desired groups.
- Returns:
Related desired state for the desired groups.
- property childs: HomieChilds#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property config: HomieConfig#
Return the Config instance containing the configuration.
- Returns:
Config instance containing the configuration.
- property desired: HomieDesired#
Return the related actions matching the provided event.
- Returns:
Related actions matching the provided event.
- property dryrun: bool#
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_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.
- 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.
- property jinja2: HomieJinja2#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property logger: HomieLogger#
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 persist: HomiePersist#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property potent: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class 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.
- 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_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.
- class enhomie.homie.HomieConfig(sargs: dict[str, Any] | None = None, files: str | Path | list[str | Path] | tuple[str | Path] | set[str] | None = None, cargs: dict[str, Any] | None = None)[source]#
Bases:
Config
Contain 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:
object
Multi-threaded service for processing the desired state.
- Parameters:
homie – Primary class instance for Homie Automate.
- property actions: HomieActions | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- check_congest() bool [source]#
Return the boolean indicating when queues are congested.
- Returns:
Boolean indicating when queues are congested.
- check_zombies() bool [source]#
Return the boolean indicating while threads are zombies.
- Returns:
Boolean indicating while threads are 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.
- 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 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.
- soft(*args: Any, **kwargs: Any) None [source]#
Stop the various threads within the Homie class object.
- Parameters:
kwargs – Keyword arguments ignored by the method.
args – Positional arguments ignored by the method.
- stop(*args: Any, **kwargs: Any) None [source]#
Stop the various threads within the Homie class object.
- Parameters:
kwargs – Keyword arguments ignored by the method.
args – Positional arguments ignored by the method.
- property streams: HomieStreams | 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.