From 6f9327fdd685ce826255c16077fdbee899722199 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 31 Jul 2024 16:36:17 +0200 Subject: [PATCH] sensor labels --- .../hottisThreeWayThermometer/hottisThreeWayThermometer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/udi/handlers/ttn/models/hottisThreeWayThermometer/hottisThreeWayThermometer.go b/src/udi/handlers/ttn/models/hottisThreeWayThermometer/hottisThreeWayThermometer.go index 3dca107..bddb2d4 100644 --- a/src/udi/handlers/ttn/models/hottisThreeWayThermometer/hottisThreeWayThermometer.go +++ b/src/udi/handlers/ttn/models/hottisThreeWayThermometer/hottisThreeWayThermometer.go @@ -31,10 +31,11 @@ func getSensorName(sensorsMap *map[string]string, sensorAddress uint64) string { } func Parse(fPort int, _ []byte, frmPayload string, variables *map[string]database.VariableType, attributes *map[string]interface{}, device *database.Device) error { + deviceAttrs := (*device).Attributes sensorsMap := make(map[string]string) - sensorsJSON, ok := (*device).Attributes["Sensors"].(string) + sensorsJSON, ok := deviceAttrs["Sensors"].(string) if !ok { - return fmt.Errorf("Unable to load sensor map from attributes: %s", (*device).Attributes) + return fmt.Errorf("Unable to load sensor map from attributes") } errJ := json.Unmarshal([]byte(sensorsJSON), &sensorsMap) if errJ != nil {