edge_st_sdk package¶
Subpackages¶
Submodules¶
edge_st_sdk.edge_client module¶
edge_client
The edge_client module contains an interface for creating edge client classes.
-
class
edge_st_sdk.edge_client.
EdgeClient
[source]¶ Bases:
object
The EdgeClient class is an interface for creating edge client classes.
-
abstract
add_listener
(listener)[source]¶ Add a listener.
- Parameters
listener (
edge_st_sdk.edge_client.EdgeClientListener
) – Listener to be added.
-
abstract
delete_shadow_state
(callback, timeout_s)[source]¶ Delete the state of the shadow client.
Delete the device shadow from the cloud by publishing an empty JSON document to the corresponding shadow topics.
- Parameters
callback – Function to be called when the response for a shadow request comes back.
timeout_s (int) – Timeout in seconds to perform the request.
-
abstract
get_shadow_state
(callback, timeout_s)[source]¶ Get the state of the shadow client.
Retrieve the device shadow JSON document from the cloud by publishing an empty JSON document to the corresponding shadow topics.
- Parameters
callback – Function to be called when the response for a shadow request comes back.
timeout_s (int) – Timeout in seconds to perform the request.
-
abstract
publish
(topic, payload, qos)[source]¶ Publish a new message to the desired topic with the given quality of service.
-
abstract
remove_listener
(listener)[source]¶ Remove a listener.
- Parameters
listener (
edge_st_sdk.edge_client.EdgeClientListener
) – Listener to be removed.
-
abstract
subscribe
(topic, qos, callback)[source]¶ Subscribe to the desired topic with the given quality of service and register a callback to handle the published messages.
-
abstract
unsubscribe
(topic)[source]¶ Unsubscribe from the desired topic.
- Parameters
topic (str) – Topic name to unsubscribe from.
-
abstract
update_shadow_state
(payload, callback, timeout_s)[source]¶ Update the state of the shadow client.
Update the device shadow JSON document string on the cloud by publishing the provided JSON document to the corresponding shadow topics.
- Parameters
payload (json) – JSON document string used to update the shadow JSON document on the cloud.
callback – Function to be called when the response for a shadow request comes back.
timeout_s (int) – Timeout in seconds to perform the request.
-
abstract
-
class
edge_st_sdk.edge_client.
EdgeClientListener
[source]¶ Bases:
object
Interface used by the
edge_st_sdk.edge_client.EdgeClient
class to notify changes of a client’s status.-
abstract
on_status_change
(client, new_status, old_status)[source]¶ To be called whenever a client changes its status.
- Parameters
client (
edge_st_sdk.edge_client.EdgeClient
) – Client that has changed its status.new_status (
edge_st_sdk.edge_client.EdgeClientStatus
) – New status.old_status (
edge_st_sdk.edge_client.EdgeClientStatus
) – Old status.
- Raises
NotImplementedError` – if the method has not been implemented.
-
abstract
-
class
edge_st_sdk.edge_client.
EdgeClientStatus
[source]¶ Bases:
enum.Enum
Status of the client.
-
CONNECTED
= 'CONNECTED'¶ Connected to the client.
-
CONNECTING
= 'CONNECTING'¶ Opening a connection with the client.
-
DISCONNECTING
= 'DISCONNECTING'¶ Closing the connection to the client.
-
IDLE
= 'IDLE'¶ Waiting for a connection and sending advertising data.
-
INIT
= 'INIT'¶ Dummy initial status.
-
UNREACHABLE
= 'UNREACHABLE'¶ The client disappeared without first disconnecting.
-