CallAction¶
- class hive.registry.CallAction¶
Bases:
QObjectCollect all catalogs of actions needed for the application and give a unique access through keyword for every available command.
Note
The keyword to call an call_action match the name of the method. Therefore, it cannot have the same name methods in multiple call_action classes.
- _catalog_action¶
list all objects containing an call_action catalog
- Type
- obj
list of call_action classes
Attributes Summary
pyqtSignal emits all logs transmits from the different catalog classes.
Methods Summary
add_action_catalog(action)Add an call_action catalog in the registry though a keyword.
command_failure_mode(*options, retry_time, ...)get_action(key, *options[, retry])Get the right method based on the keyword.
manage_failure(error, retry, key, *options)retry_failure_mode(key, *options, retry_time)set_handler(failure_handler)set_user(username)Set the user in the communication protocol of all call_action class listed in the registry.
setup(hdw_type, device_id)Call the setup method based on the type of the device.
Attributes Documentation
Methods Documentation
- add_action_catalog(action)¶
Add an call_action catalog in the registry though a keyword.
- Parameters
action (
object) – Append the catalog object created before calling this method
- command_failure_mode(*options, retry_time, **replace_command)¶
- get_action(key, *options, retry=0)¶
Get the right method based on the keyword.
- Parameters
key (
str) – keyword - should be the name of one the method in the call_action class.
- manage_failure(error, retry, key, *options)¶
- retry_failure_mode(key, *options, retry_time, wait_time=0, **kwargs)¶
- set_handler(failure_handler)¶
- set_user(username)¶
Set the user in the communication protocol of all call_action class listed in the registry.
- Parameters
username (
str) –
- setup(hdw_type, device_id)¶
Call the setup method based on the type of the device.
- Parameters
hdw_type (
str) – device type (example: door, food_delivery… etc.)device_id (
intorstr) –: (.. note) – An call_action class should have a method called type_setup for each device type it is using.: