Beispiel #1
0
 def convert(self, config, data):
     value = None
     if isinstance(data, ReadPropertyACK):
         value = self.__property_value_from_apdu(data)
     if config is not None:
         datatypes = {
             "attributes": "attributes",
             "timeseries": "telemetry",
             "telemetry": "telemetry"
         }
         dict_result = {
             "deviceName": None,
             "deviceType": None,
             "attributes": [],
             "telemetry": []
         }
         dict_result["deviceName"] = self.__config.get(
             "deviceName", config[1].get("name", "BACnet device"))
         dict_result["deviceType"] = self.__config.get(
             "deviceType", "default")
         dict_result[datatypes[config[0]]].append({config[1]["key"]: value})
     else:
         dict_result = value
     log.debug("%r %r", self, dict_result)
     return dict_result
Beispiel #2
0
 def convert(self, config, data):
     log.debug(config, data)