CallAction

class hive.registry.CallAction

Bases: QObject

Collect 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

log

pyqtSignal emits all logs transmits from the different catalog classes.

Methods Summary

add_action_catalog(key, communication)

Add an call_action catalog in the registry though a keyword.

get_action(key, *options)

Get the right method based on the keyword.

set_user(username)

Set the user in the communication protocol of all call_action class listed in the registry.

setup(type, device_id)

Call the setup method based on the type of the device.

Attributes Documentation

log

pyqtSignal emits all logs transmits from the different catalog classes.

Type

str

Methods Documentation

add_action_catalog(key, communication)

Add an call_action catalog in the registry though a keyword.

Parameters
  • key (str, {fklab_maze}) – Create the corresponding call_action class.

  • communication – give the communication object associated the call_action class.

get_action(key, *options)

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.

set_user(username)

Set the user in the communication protocol of all call_action class listed in the registry.

Parameters

username (str) –

setup(type, device_id)

Call the setup method based on the type of the device.

Parameters
  • type (str) – device type (example: door, food_delivery… etc.)

  • device_id (int or str) –

  • : (.. note) – An call_action class should have a method called type_setup for each device type it is using.: