Simple MQTT client implementation that fits nalkinscloud projects
Project description
nalkinscloud-mqtt-python-client
MQTT Client package for nalkinscloud project usage
Usage
## activate package logging by:
# logging.getLogger('nalkinscloud_mqtt_python_client')
from nalkinscloud_mqtt_python_client.devices import SwitchDevice
def set_switch_state(state):
print("SET SWITCH STATE HERE")
return state
device = SwitchDevice(set_data_function=set_switch_state)
device.init_broker(broker_host="mosquitto.alpha.nalkins.cloud",
broker_port=8883,
broker_cert=None,
broker_tls=True,
broker_tls_skip=True)
# this client will have default 'on_connect' function, but a custom 'on_message' function
device.init_device(device_id='some_device_id', device_type='sensor', device_password='none', qos=0)
device.connect()
device.subscribe("v1/devices/me/rpc/request/+", 1)
# Start the MQTT Mosquito process loop
device.do_loop_forever()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for nalkinscloud_mqtt_python_client-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9431d8f6f05b1b3bbbe40a5e3bdd818ffa53991fda508006e5c21d1799ebab0 |
|
MD5 | d8ba24521b730d7fe5bba2f2fa5a6595 |
|
BLAKE2b-256 | e45a1b39882f57dfce74f82a54a40374e447080b7ad1cb6bfa0f9aab2a208d31 |