diff --git a/src/udi/config-iot2.json b/src/udi/config-iot2.json index 6acca73..c9680b5 100644 --- a/src/udi/config-iot2.json +++ b/src/udi/config-iot2.json @@ -5,16 +5,12 @@ }, "topicMappings": [ { - "topics": [ "shellyplusht/+/status/temperature:0" ], - "handler": "SVEJ", - "id": "SVE3", + "topics": [ "ttn/#" ], + "handler": "TTN", + "id": "TTN0", "config": { "databaseConnStr": "", "attributes": { - "application": "Temperature Shelly Plus HT", - "deviceSelector": "T:1", - "valueSelector": "J:$.tC", - "unitSelector": "C:°C" } } } diff --git a/src/udi/handlers/ttn/ttn.go b/src/udi/handlers/ttn/ttn.go index 2d582fa..144ca3d 100644 --- a/src/udi/handlers/ttn/ttn.go +++ b/src/udi/handlers/ttn/ttn.go @@ -2,6 +2,7 @@ package ttn import "log" import "fmt" +import "udi/config" import "udi/handlers/handler" var idSeq int = 0 @@ -10,7 +11,8 @@ type TTNHandler struct { id int } -func NewTTNHandler() handler.Handler { + +func NewTTNHandler(config config.HandlerConfigT) handler.Handler { t := &TTNHandler { id: idSeq, }