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
Release files for guozhi 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| guozhi-0.1.6.tar.gz | 8.2 kB | Details |
Release files / guozhi-0.1.6.tar.gz
| Download URL | guozhi-0.1.6.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf9f08dfc1df351b6c3aae8fcc5065a4a90034910f8cdc681a711f47dcf3c629
|
|
BLAKE2b-256 checksum How to use checksums |
422a952ba9bd9eac6a88c59acbdd8bc66347b25b739cac9219d2168c19c63811
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|