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.
- pydantic model enrobie.plugins.enhomie.params.HomiePluginCommandParams[source]#
Bases:
RobieParamsModel
Process and validate the Robie configuration parameters.
Show JSON schema
{ "title": "HomiePluginCommandParams", "description": "Process and validate the Robie configuration parameters.", "type": "object", "properties": { "irc": { "default": "!persist", "description": "Command name for chat platform", "minLength": 2, "title": "Irc", "type": "string" }, "dsc": { "default": "!persist", "description": "Command name for chat platform", "minLength": 2, "title": "Dsc", "type": "string" }, "mtm": { "default": "!persist", "description": "Command name for chat platform", "minLength": 2, "title": "Mtm", "type": "string" } }, "additionalProperties": false }
- field dsc: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!persist', description='Command name for chat platform', metadata=[MinLen(min_length=2)])] = '!persist'#
Command name for chat platform
- Constraints:
min_length = 2
- pydantic model enrobie.plugins.enhomie.params.HomiePluginParams[source]#
Bases:
RobiePluginParams
Process and validate the Robie configuration parameters.
Show JSON schema
{ "title": "HomiePluginParams", "description": "Process and validate the Robie configuration parameters.", "type": "object", "properties": { "enable": { "default": false, "description": "Determine whether child enabled", "title": "Enable", "type": "boolean" }, "locate": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "For which plugin are parameters", "examples": [ "enrobie.plugins.AinswerPlugin", "enrobie.plugins.AutoJoinPlugin", "enrobie.plugins.AutoNickPlugin", "enrobie.plugins.StatusPlugin" ], "title": "Locate" }, "trusted": { "anyOf": [ { "items": { "type": "string" }, "minItems": 1, "type": "array" }, { "type": "null" } ], "default": null, "description": "Users are trusted by the plugin", "title": "Trusted" }, "command": { "$ref": "#/$defs/HomiePluginCommandParams", "description": "Command name per chat platform" }, "restful": { "description": "Where to find the RESTful API", "examples": [ "http://localhost:8420" ], "minLength": 1, "title": "Restful", "type": "string" }, "username": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Authenticate with the service", "title": "Username" }, "password": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Authenticate with the service", "title": "Password" }, "timeout": { "default": 30, "description": "Timeout connecting to server", "maximum": 300, "minimum": 1, "title": "Timeout", "type": "integer" }, "ssl_verify": { "default": true, "description": "Verify the ceritifcate valid", "title": "Ssl Verify", "type": "boolean" }, "ssl_capem": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Verify the ceritifcate valid", "title": "Ssl Capem" }, "clients": { "description": "List of clients to enable plugin", "items": { "type": "string" }, "minItems": 1, "title": "Clients", "type": "array" }, "status": { "$ref": "#/$defs/StatusPluginIconParams", "description": "Icon used per chat platform" } }, "$defs": { "HomiePluginCommandParams": { "additionalProperties": false, "description": "Process and validate the Robie configuration parameters.", "properties": { "irc": { "default": "!persist", "description": "Command name for chat platform", "minLength": 2, "title": "Irc", "type": "string" }, "dsc": { "default": "!persist", "description": "Command name for chat platform", "minLength": 2, "title": "Dsc", "type": "string" }, "mtm": { "default": "!persist", "description": "Command name for chat platform", "minLength": 2, "title": "Mtm", "type": "string" } }, "title": "HomiePluginCommandParams", "type": "object" }, "StatusPluginIconParams": { "additionalProperties": false, "description": "Contain information for constructing the chat messages.", "properties": { "irc": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Icon used for the chat platform", "title": "Irc" }, "dsc": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Icon used for the chat platform", "title": "Dsc" }, "mtm": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Icon used for the chat platform", "title": "Mtm" } }, "title": "StatusPluginIconParams", "type": "object" } }, "additionalProperties": false, "required": [ "restful", "clients" ] }
- Config:
extra: str = forbid
- Fields:
- field clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])] [Required]#
List of clients to enable plugin
- Constraints:
min_length = 1
- field command: Annotated[HomiePluginCommandParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomiePluginCommandParams, description='Command name per chat platform')] [Optional]#
Command name per chat platform
- field enable: Annotated[bool, Field(False, description='Determine whether child enabled')] = False#
Determine whether child enabled
- field locate: Annotated[str | None, Field(None, description='For which plugin are parameters', examples=['enrobie.plugins.AinswerPlugin', 'enrobie.plugins.AutoJoinPlugin', 'enrobie.plugins.AutoNickPlugin', 'enrobie.plugins.StatusPlugin'], min_length=1)] = None#
For which plugin are parameters
- Constraints:
min_length = 1
- field password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])] = None#
Authenticate with the service
- Constraints:
min_length = 1
- field restful: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Where to find the RESTful API', examples=['http://localhost:8420'], metadata=[MinLen(min_length=1)])] [Required]#
Where to find the RESTful API
- Constraints:
min_length = 1
- field ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])] = None#
Verify the ceritifcate valid
- Constraints:
min_length = 1
- field ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')] = True#
Verify the ceritifcate valid
- field status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')] [Optional]#
Icon used per chat platform
- field timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])] = 30#
Timeout connecting to server
- Constraints:
ge = 1
le = 300
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.
- pydantic model enrobie.plugins.enhomie.persist.HomiePersistRecord[source]#
Bases:
BaseModel
Information relevant to Homie Automate persistent value.
Show JSON schema
{ "title": "HomiePersistRecord", "description": "Information relevant to Homie Automate persistent value.", "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" }, "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" }, "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" } }, "required": [ "unique", "value", "update" ] }
- Config:
extra: str = ignore
- 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_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
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.
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.
- pydantic model enrobie.plugins.enhomie.HomiePluginParams[source]#
Bases:
RobiePluginParams
Process and validate the Robie configuration parameters.
Show JSON schema
{ "title": "HomiePluginParams", "description": "Process and validate the Robie configuration parameters.", "type": "object", "properties": { "enable": { "default": false, "description": "Determine whether child enabled", "title": "Enable", "type": "boolean" }, "locate": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "For which plugin are parameters", "examples": [ "enrobie.plugins.AinswerPlugin", "enrobie.plugins.AutoJoinPlugin", "enrobie.plugins.AutoNickPlugin", "enrobie.plugins.StatusPlugin" ], "title": "Locate" }, "trusted": { "anyOf": [ { "items": { "type": "string" }, "minItems": 1, "type": "array" }, { "type": "null" } ], "default": null, "description": "Users are trusted by the plugin", "title": "Trusted" }, "command": { "$ref": "#/$defs/HomiePluginCommandParams", "description": "Command name per chat platform" }, "restful": { "description": "Where to find the RESTful API", "examples": [ "http://localhost:8420" ], "minLength": 1, "title": "Restful", "type": "string" }, "username": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Authenticate with the service", "title": "Username" }, "password": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Authenticate with the service", "title": "Password" }, "timeout": { "default": 30, "description": "Timeout connecting to server", "maximum": 300, "minimum": 1, "title": "Timeout", "type": "integer" }, "ssl_verify": { "default": true, "description": "Verify the ceritifcate valid", "title": "Ssl Verify", "type": "boolean" }, "ssl_capem": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Verify the ceritifcate valid", "title": "Ssl Capem" }, "clients": { "description": "List of clients to enable plugin", "items": { "type": "string" }, "minItems": 1, "title": "Clients", "type": "array" }, "status": { "$ref": "#/$defs/StatusPluginIconParams", "description": "Icon used per chat platform" } }, "$defs": { "HomiePluginCommandParams": { "additionalProperties": false, "description": "Process and validate the Robie configuration parameters.", "properties": { "irc": { "default": "!persist", "description": "Command name for chat platform", "minLength": 2, "title": "Irc", "type": "string" }, "dsc": { "default": "!persist", "description": "Command name for chat platform", "minLength": 2, "title": "Dsc", "type": "string" }, "mtm": { "default": "!persist", "description": "Command name for chat platform", "minLength": 2, "title": "Mtm", "type": "string" } }, "title": "HomiePluginCommandParams", "type": "object" }, "StatusPluginIconParams": { "additionalProperties": false, "description": "Contain information for constructing the chat messages.", "properties": { "irc": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Icon used for the chat platform", "title": "Irc" }, "dsc": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Icon used for the chat platform", "title": "Dsc" }, "mtm": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Icon used for the chat platform", "title": "Mtm" } }, "title": "StatusPluginIconParams", "type": "object" } }, "additionalProperties": false, "required": [ "restful", "clients" ] }
- Config:
extra: str = forbid
- Fields:
- field clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])] [Required]#
List of clients to enable plugin
- Constraints:
min_length = 1
- field command: Annotated[HomiePluginCommandParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomiePluginCommandParams, description='Command name per chat platform')] [Optional]#
Command name per chat platform
- field enable: Annotated[bool, Field(False, description='Determine whether child enabled')] = False#
Determine whether child enabled
- field locate: Annotated[str | None, Field(None, description='For which plugin are parameters', examples=['enrobie.plugins.AinswerPlugin', 'enrobie.plugins.AutoJoinPlugin', 'enrobie.plugins.AutoNickPlugin', 'enrobie.plugins.StatusPlugin'], min_length=1)] = None#
For which plugin are parameters
- Constraints:
min_length = 1
- field password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])] = None#
Authenticate with the service
- Constraints:
min_length = 1
- field restful: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Where to find the RESTful API', examples=['http://localhost:8420'], metadata=[MinLen(min_length=1)])] [Required]#
Where to find the RESTful API
- Constraints:
min_length = 1
- field ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])] = None#
Verify the ceritifcate valid
- Constraints:
min_length = 1
- field ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')] = True#
Verify the ceritifcate valid
- field status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')] [Optional]#
Icon used per chat platform
- field timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])] = 30#
Timeout connecting to server
- Constraints:
ge = 1
le = 300