enrobie.plugins.enhomie package#

Subpackages#

Submodules#

enrobie.plugins.enhomie.ainswer module#

Functions and routines associated with Enasis Network Chatting Robie.

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

async enrobie.plugins.enhomie.ainswer.homie_persist(context: RunContext[AinswerDepends]) list[HomiePersistRecord][source]#

Return the current values in Homie Automate persistence.

Note

This tool will return values from the Homie Automate persistence store. They may include information about many things regarding the Robie owner home status.

Returns:

Current values in Homie Automate persistence.

enrobie.plugins.enhomie.helpers module#

Functions and routines associated with Enasis Network Chatting Robie.

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

enrobie.plugins.enhomie.helpers.composedsc(plugin: HomiePlugin, mitem: RobieMessage) None[source]#

Construct and format message for related chat platform.

Parameters:
  • plugin – Plugin class instance for Chatting Robie.

  • mitem – Item containing information for operation.

enrobie.plugins.enhomie.helpers.composeirc(plugin: HomiePlugin, mitem: RobieMessage) None[source]#

Construct and format message for related chat platform.

Parameters:
  • plugin – Plugin class instance for Chatting Robie.

  • mitem – Item containing information for operation.

enrobie.plugins.enhomie.helpers.composemtm(plugin: HomiePlugin, mitem: RobieMessage) None[source]#

Construct and format message for related chat platform.

Parameters:
  • plugin – Plugin class instance for Chatting Robie.

  • mitem – Item containing information for operation.

enrobie.plugins.enhomie.params module#

Functions and routines associated with Enasis Network Chatting Robie.

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

class enrobie.plugins.enhomie.params.HomiePluginCommandParams(*, irc: Annotated[str, MinLen(min_length=2)] = '!persist', dsc: Annotated[str, MinLen(min_length=2)] = '!persist', mtm: Annotated[str, MinLen(min_length=2)] = '!persist')[source]#

Bases: RobieParamsModel

Process and validate the Robie configuration parameters.

dsc: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!persist', description='Command name for chat platform', metadata=[MinLen(min_length=2)])]#
irc: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!persist', description='Command name for chat platform', metadata=[MinLen(min_length=2)])]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

mtm: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!persist', description='Command name for chat platform', metadata=[MinLen(min_length=2)])]#
class enrobie.plugins.enhomie.params.HomiePluginParams(_parse: ~typing.Callable[[...], ~typing.Any] | None = None, *, enable: bool = False, locate: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, trusted: ~typing.Annotated[list[str] | None, ~annotated_types.MinLen(min_length=1)] = None, command: ~enrobie.plugins.enhomie.params.HomiePluginCommandParams = <factory>, restful: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], username: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, password: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, timeout: ~typing.Annotated[int, ~annotated_types.Ge(ge=1), ~annotated_types.Le(le=300)] = 30, ssl_verify: bool = True, ssl_capem: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, clients: ~typing.Annotated[list[str], ~annotated_types.MinLen(min_length=1)], status: ~enrobie.plugins.status.params.StatusPluginIconParams = <factory>)[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])]#
command: Annotated[HomiePluginCommandParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomiePluginCommandParams, description='Command name per chat platform')]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#
restful: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Where to find the RESTful API', examples=['http://localhost:8420'], metadata=[MinLen(min_length=1)])]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])]#
ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
username: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#

enrobie.plugins.enhomie.persist module#

Functions and routines associated with Enasis Network Chatting Robie.

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

class enrobie.plugins.enhomie.persist.HomiePersist(plugin: HomiePlugin)[source]#

Bases: object

Collect the information using the upstream API endpoint.

Parameters:

plugin – Plugin class instance for Chatting Robie.

property client: HTTPClient#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

record(unique: str) HomiePersistRecord[source]#

Return the response from upstream API endpoint request.

Parameters:

unique – Unique identifier from within the table.

Returns:

Response from upstream API endpoint request.

property records: list[HomiePersistRecord]#

Return the response from upstream API endpoint request.

Returns:

Response from upstream API endpoint request.

request() Response[source]#

Return the response from upstream API endpoint request.

Parameters:

item – Determine which items will be enumerated.

Returns:

Response from upstream API endpoint request.

class enrobie.plugins.enhomie.persist.HomiePersistRecord(*, 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, about: Annotated[str | None, MinLen(min_length=1)] = None, about_label: 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: BaseModel

Information relevant to Homie Automate persistent value.

about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='About the 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': 'ignore'}#

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_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist value', metadata=[MinLen(min_length=1)])]#
value_unit: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Unit for persist value', metadata=[MinLen(min_length=1)])]#

enrobie.plugins.enhomie.plugin module#

Functions and routines associated with Enasis Network Chatting Robie.

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

class enrobie.plugins.enhomie.plugin.HomiePlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin allows for connecting to Homie Automate.

ainswer() list[Callable[[...], Any]][source]#

Return the Ainswer tools that are related to the plugin.

Returns:

Ainswer tools that are related to the plugin.

operate() None[source]#

Perform the operation related to Robie service threads.

Parameters:

thread – Child class instance for Chatting Robie.

property params: HomiePluginParams#

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.

classmethod schema() Type[HomiePluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

validate() None[source]#

Perform advanced validation on the parameters provided.

Module contents#

Functions and routines associated with Enasis Network Chatting Robie.

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

class enrobie.plugins.enhomie.HomiePlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin allows for connecting to Homie Automate.

ainswer() list[Callable[[...], Any]][source]#

Return the Ainswer tools that are related to the plugin.

Returns:

Ainswer tools that are related to the plugin.

operate() None[source]#

Perform the operation related to Robie service threads.

Parameters:

thread – Child class instance for Chatting Robie.

property params: HomiePluginParams#

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.

classmethod schema() Type[HomiePluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

validate() None[source]#

Perform advanced validation on the parameters provided.

class enrobie.plugins.enhomie.HomiePluginParams(_parse: ~typing.Callable[[...], ~typing.Any] | None = None, *, enable: bool = False, locate: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, trusted: ~typing.Annotated[list[str] | None, ~annotated_types.MinLen(min_length=1)] = None, command: ~enrobie.plugins.enhomie.params.HomiePluginCommandParams = <factory>, restful: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], username: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, password: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, timeout: ~typing.Annotated[int, ~annotated_types.Ge(ge=1), ~annotated_types.Le(le=300)] = 30, ssl_verify: bool = True, ssl_capem: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, clients: ~typing.Annotated[list[str], ~annotated_types.MinLen(min_length=1)], status: ~enrobie.plugins.status.params.StatusPluginIconParams = <factory>)[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])]#
command: Annotated[HomiePluginCommandParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomiePluginCommandParams, description='Command name per chat platform')]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#
restful: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Where to find the RESTful API', examples=['http://localhost:8420'], metadata=[MinLen(min_length=1)])]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])]#
ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
username: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#