Skip to content

Commit

Permalink
Added ability to use expressions in keys in MQTT bytes uplink converter
Browse files Browse the repository at this point in the history
  • Loading branch information
imbeacon committed Nov 21, 2024
1 parent fa54c5c commit eebf336
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def convert(self, topic, data):
for datatype in datatypes:
dict_result[datatypes[datatype]] = []
for datatype_config in self.__config.get(datatype, []):
value_item = {datatype_config['key']: self.parse_data(datatype_config['value'], data)}
key = self.parse_data(datatype_config['key'], data)
value_item = {key: self.parse_data(datatype_config['value'], data)}
if datatype == 'timeseries':
dict_result[datatypes[datatype]].append({"ts": int(time.time()) * 1000, 'values': value_item})
else:
Expand Down

0 comments on commit eebf336

Please sign in to comment.