enrobie.plugins.enhomie package#

Submodules#

enrobie.plugins.enhomie.ainswer module#

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#

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#

class enrobie.plugins.enhomie.params.HomiePluginCommandParams[source]#

Bases: RobieParamsModel

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

dsc

str

No

'!persist'

min_length=2

irc

str

No

'!persist'

min_length=2

mtm

str

No

'!persist'

min_length=2

irc: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!persist', description='Command name for chat platform', metadata=[MinLen(min_length=2)])]#
dsc: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!persist', description='Command name for chat platform', metadata=[MinLen(min_length=2)])]#
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[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

clients

list[str]

Yes

min_length=1

command

HomiePluginCommandParams

No

factory

enable

bool

No

False

locate

str | None

No

None

min_length=1

password

str | None

No

None

min_length=1

restful

str

Yes

min_length=1

ssl_capem

str | None

No

None

min_length=1

ssl_verify

bool

No

True

status

StatusPluginIconParams

No

factory

timeout

int

No

30

ge=1, le=300

trusted

list[str] | None

No

None

min_length=1

username

str | None

No

None

min_length=1

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

enrobie.plugins.enhomie.persist module#

class enrobie.plugins.enhomie.persist.HomiePersistRecord[source]#

Bases: BaseModel

Information relevant to Homie Automate persistent value.

Fields#

Field

Type

Required

Default

Constraints

about

str | None

No

None

min_length=1

about_label

str | None

No

None

min_length=1

expire

str | None

No

None

min_length=20, max_length=32

level

Literal[‘failure’, ‘information’, ‘success’, ‘warning’] | None

No

None

min_length=1

tags

list[str] | None

No

None

min_length=1

unique

str

Yes

min_length=1

update

str

Yes

min_length=20, max_length=32

value

int | float | bool | str | None

Yes

value_label

str | None

No

None

min_length=1

value_unit

str | None

No

None

min_length=1

unique: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Unique key for the value', metadata=[MinLen(min_length=1)])]#
value: Annotated[int | float | bool | str | None, FieldInfo(annotation=NoneType, required=True, description='Value stored at unique')]#
value_unit: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Unit for persist value', metadata=[MinLen(min_length=1)])]#
value_label: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Label for persist value', metadata=[MinLen(min_length=1)])]#
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)])]#
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)])]#
tags: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Tags 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)])]#
update: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='When the value was updated', metadata=[MinLen(min_length=20), MaxLen(max_length=32)])]#
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.

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.

property records: list[HomiePersistRecord]#

Return the response from upstream API endpoint request.

Returns:

Response from upstream API endpoint request.

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.

enrobie.plugins.enhomie.plugin module#

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.

validate() None[source]#

Perform advanced validation on the parameters provided.

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

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

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.

operate() None[source]#

Perform the operation related to Robie service threads.

Parameters:

thread – Child class instance for Chatting Robie.

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

Return the Ainswer tools that are related to the plugin.

Returns:

Ainswer tools that are related to the plugin.

Module contents#

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.

validate() None[source]#

Perform advanced validation on the parameters provided.

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

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

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.

operate() None[source]#

Perform the operation related to Robie service threads.

Parameters:

thread – Child class instance for Chatting Robie.

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

Return the Ainswer tools that are related to the plugin.

Returns:

Ainswer tools that are related to the plugin.

class enrobie.plugins.enhomie.HomiePluginParams[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

clients

list[str]

Yes

min_length=1

command

HomiePluginCommandParams

No

factory

enable

bool

No

False

locate

str | None

No

None

min_length=1

password

str | None

No

None

min_length=1

restful

str

Yes

min_length=1

ssl_capem

str | None

No

None

min_length=1

ssl_verify

bool

No

True

status

StatusPluginIconParams

No

factory

timeout

int

No

30

ge=1, le=300

trusted

list[str] | None

No

None

min_length=1

username

str | None

No

None

min_length=1

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