From acdd659bac4d1bc35db3f808307d46d6ccecf9f4 Mon Sep 17 00:00:00 2001 From: pennam Date: Mon, 3 Oct 2022 09:33:36 +0200 Subject: [PATCH 1/2] Match thing variable_name with dashboard variable_id --- internal/template/dashboard.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/template/dashboard.go b/internal/template/dashboard.go index 607cf08e..82cf6124 100644 --- a/internal/template/dashboard.go +++ b/internal/template/dashboard.go @@ -75,7 +75,7 @@ func getVariableID(thingID string, variableName string, fetcher ThingFetcher) (s } for _, v := range thing.Properties { - if v.Name == variableName { + if v.VariableName == variableName { return v.Id, nil } } From bc0710ba553c924223693740c5f3293ba9dee098 Mon Sep 17 00:00:00 2001 From: pennam Date: Mon, 3 Oct 2022 10:19:01 +0200 Subject: [PATCH 2/2] Fix dashboard with variable tests --- internal/template/load_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/template/load_test.go b/internal/template/load_test.go index 01d95bbe..18a5f71e 100644 --- a/internal/template/load_test.go +++ b/internal/template/load_test.go @@ -149,15 +149,15 @@ func (t *thingShowTest) ThingShow(thingID string) (*iotclient.ArduinoThing, erro if thingID == thingOverriddenID { return &iotclient.ArduinoThing{ Properties: []iotclient.ArduinoProperty{ - {Id: switchyOverriddenID, Name: "switchy"}, + {Id: switchyOverriddenID, VariableName: "switchy"}, }, }, nil } return &iotclient.ArduinoThing{ Properties: []iotclient.ArduinoProperty{ - {Id: switchyID, Name: "switchy"}, - {Id: relayID, Name: "relay_2"}, - {Id: blinkSpeedID, Name: "blink_speed"}, + {Id: switchyID, VariableName: "switchy"}, + {Id: relayID, VariableName: "relay_2"}, + {Id: blinkSpeedID, VariableName: "blink_speed"}, }, }, nil }