Skip to main content

python-iot-sdk for guozhiyun

Project description



果汁云IOT的Python SDK 主项目: JAVA-SDK:


  1. 安装python环境(>2.6)
  2. pip install guozhi


  1. 以下可直接连接到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
  1. 扩展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 hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page