You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
command (CommandDetails): Command object of which status needs to be updated
26
18
status (CommandStatus): New status of the command
27
19
ackdata (str | bytes | None, optional): Data to be submitted along with acknowledgement. Maximum 1 kB of data is allowed. Defaults to None.
28
20
acktype (str, optional): Specify the type of data submitted. Defaults to "string".
29
21
timeout (float | None, optional): Time out in seconds for the request. In production setup it is advisable to use a timeout or else your program can get stuck indefinitely. Defaults to None.
22
+
callback_mode (bool, optional): When using MQTT connection, it is not possible to publish the message from inside a callback. In such scenario, you can set callback_mode to True. Instead of publishing request right away, the function
23
+
schedules the message to be published after the callback is completed. Also function returns a transaction object. Which can be used to check whether transaction has finished or not and what is the status of transaction.
24
+
Use this method only when only single transaction is happening at a time. In the case where multiple transactions happening simultaneously, we suggest avoiding call to this function from within callback.Defaults to False.
30
25
31
26
Raises:
32
27
AnedyaInvalidConfig: Invalid configuration
33
28
AnedyaInvalidType: Invalid datatype is specified
34
29
AnedyaTxFailure: Transaction failure
30
+
31
+
Returns:
32
+
None | Transaction: Returns transaction object if callback_mode is True. returns None otherwise
35
33
"""
36
34
ifself._configisNone:
37
35
raiseAnedyaInvalidConfig('Configuration not provided')
0 commit comments