python-iot-sdk for guozhiyun
Project description
jucie-python-sdk
项目介绍
果汁云IOT的Python SDK 主项目:https://gitee.com/haonan108/juice-cloud JAVA-SDK:https://gitee.com/haonan108/juice-java-sdk
安装教程
- 安装python环境(>2.6)
- pip install guozhi
使用说明
- 以下可直接连接到guozhiyun平台
from juice.MqttClient import MqttClient
from juice.handler.extend.sensor.SoudSetHandler import SoudSetHandler
from juice.handler.extend.device.TempGetHandler import TempGetHandler
get_handler_dict = {'temp': TempGetHandler()} # 读取设备温度
set_handler_dict = {'soud': SoudSetHandler()} # 设置蜂鸣器(传感器)状态
if __name__ == '__main__':
# 填入产品code、设备code、密钥(需在www.guozhiyun.cn上申请)
mqtt = MqttClient('product_code', 'device_code', 'secret')
mqtt.get_message = get_handler_dict
mqtt.set_message = set_handler_dict
mqtt.init()
- 扩展Handler,需要继承PropGetHandler或PropSetHandler,并实现handle方法,可参考SoudSetHandler,TempGetHandler
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
guozhi-0.1.6.tar.gz
(8.2 kB
view details)
File details
Details for the file guozhi-0.1.6.tar.gz
.
File metadata
- Download URL: guozhi-0.1.6.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.6.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
cf9f08dfc1df351b6c3aae8fcc5065a4a90034910f8cdc681a711f47dcf3c629
|
|
MD5 |
7eb7a37e2afff949319161af6502055d
|
|
BLAKE2b-256 |
422a952ba9bd9eac6a88c59acbdd8bc66347b25b739cac9219d2168c19c63811
|