def reportProperties()

in leda_python/leda.py [0:0]


    def reportProperties(self, propertiesDict):
        '''上报属性
			:param propertiesDict[dict]: 格式如下:
				{
					"propertyName1": xxx,
					"propertyName2": yyy,
					...
				}
			:return:
		'''
        if (False == isinstance(propertiesDict, dict)):
            raise exception.LedaReportPropertyException(
                "device(%s):reportProperties,params type is invalid: %s" % (self.cloud_id, type(propertiesDict)))

        tmpPropertiesDict = {}
        for key, value in propertiesDict.items():
            tmpPropertiesDict[key] = {}
            tmpPropertiesDict[key]['value'] = value
            tmpPropertiesDict[key]['time'] = int(round(time.time() * 1000))

        self.device_report_property(json.dumps(tmpPropertiesDict, cls=json_coder.Json_Encoder, ensure_ascii = False))