diff --git a/src/udi/handlers/ttn/models/draginoLdds75/draginoLdds75.go b/attic/ttn/models/draginoLdds75/draginoLdds75.go similarity index 100% rename from src/udi/handlers/ttn/models/draginoLdds75/draginoLdds75.go rename to attic/ttn/models/draginoLdds75/draginoLdds75.go diff --git a/src/udi/handlers/ttn/models/draginoLdds75/example-ldds75.json b/attic/ttn/models/draginoLdds75/example-ldds75.json similarity index 100% rename from src/udi/handlers/ttn/models/draginoLdds75/example-ldds75.json rename to attic/ttn/models/draginoLdds75/example-ldds75.json diff --git a/src/udi/handlers/ttn/models/draginoLmds200/draginoLmds200.go b/attic/ttn/models/draginoLmds200/draginoLmds200.go similarity index 100% rename from src/udi/handlers/ttn/models/draginoLmds200/draginoLmds200.go rename to attic/ttn/models/draginoLmds200/draginoLmds200.go diff --git a/src/udi/handlers/ttn/models/draginoLmds200/lmds200-example.json b/attic/ttn/models/draginoLmds200/lmds200-example.json similarity index 100% rename from src/udi/handlers/ttn/models/draginoLmds200/lmds200-example.json rename to attic/ttn/models/draginoLmds200/lmds200-example.json diff --git a/src/udi/handlers/ttn/models/draginoLse01/draginoLse01.go b/attic/ttn/models/draginoLse01/draginoLse01.go similarity index 100% rename from src/udi/handlers/ttn/models/draginoLse01/draginoLse01.go rename to attic/ttn/models/draginoLse01/draginoLse01.go diff --git a/src/udi/handlers/ttn/models/draginoLsn50/draginoLsn50.go b/attic/ttn/models/draginoLsn50/draginoLsn50.go similarity index 100% rename from src/udi/handlers/ttn/models/draginoLsn50/draginoLsn50.go rename to attic/ttn/models/draginoLsn50/draginoLsn50.go diff --git a/src/udi/handlers/ttn/models/emuProfIILoRaCfg1/emu-fprot1-example.json b/attic/ttn/models/emuProfIILoRaCfg1/emu-fprot1-example.json similarity index 100% rename from src/udi/handlers/ttn/models/emuProfIILoRaCfg1/emu-fprot1-example.json rename to attic/ttn/models/emuProfIILoRaCfg1/emu-fprot1-example.json diff --git a/src/udi/handlers/ttn/models/emuProfIILoRaCfg1/emu-fprot2-example.json b/attic/ttn/models/emuProfIILoRaCfg1/emu-fprot2-example.json similarity index 100% rename from src/udi/handlers/ttn/models/emuProfIILoRaCfg1/emu-fprot2-example.json rename to attic/ttn/models/emuProfIILoRaCfg1/emu-fprot2-example.json diff --git a/src/udi/handlers/ttn/models/emuProfIILoRaCfg1/emuProfIILoRaCfg1.go b/attic/ttn/models/emuProfIILoRaCfg1/emuProfIILoRaCfg1.go similarity index 100% rename from src/udi/handlers/ttn/models/emuProfIILoRaCfg1/emuProfIILoRaCfg1.go rename to attic/ttn/models/emuProfIILoRaCfg1/emuProfIILoRaCfg1.go diff --git a/src/udi/handlers/ttn/models/hottisGy21/hottisGY21.go b/attic/ttn/models/hottisGy21/hottisGY21.go similarity index 100% rename from src/udi/handlers/ttn/models/hottisGy21/hottisGY21.go rename to attic/ttn/models/hottisGy21/hottisGY21.go diff --git a/src/udi/handlers/ttn/models/hottisScd30/hottisScd30.go b/attic/ttn/models/hottisScd30/hottisScd30.go similarity index 100% rename from src/udi/handlers/ttn/models/hottisScd30/hottisScd30.go rename to attic/ttn/models/hottisScd30/hottisScd30.go diff --git a/src/udi/handlers/ttn/models/hottisThreeWayThermometer/hottisThreeWayThermometer.go b/attic/ttn/models/hottisThreeWayThermometer/hottisThreeWayThermometer.go similarity index 100% rename from src/udi/handlers/ttn/models/hottisThreeWayThermometer/hottisThreeWayThermometer.go rename to attic/ttn/models/hottisThreeWayThermometer/hottisThreeWayThermometer.go diff --git a/src/udi/handlers/ttn/models/rawPayloadPrinter/rawPayloadPrinter.go b/attic/ttn/models/rawPayloadPrinter/rawPayloadPrinter.go similarity index 100% rename from src/udi/handlers/ttn/models/rawPayloadPrinter/rawPayloadPrinter.go rename to attic/ttn/models/rawPayloadPrinter/rawPayloadPrinter.go diff --git a/src/udi/handlers/ttn/ttn.go b/attic/ttn/ttn.go similarity index 100% rename from src/udi/handlers/ttn/ttn.go rename to attic/ttn/ttn.go diff --git a/src/udi/handlers/z2m/models/gs361ah04/gs361ah04.go b/attic/z2m/models/gs361ah04/gs361ah04.go similarity index 100% rename from src/udi/handlers/z2m/models/gs361ah04/gs361ah04.go rename to attic/z2m/models/gs361ah04/gs361ah04.go diff --git a/src/udi/handlers/z2m/models/wsdcgq01lm/wsdcgq01lm.go b/attic/z2m/models/wsdcgq01lm/wsdcgq01lm.go similarity index 100% rename from src/udi/handlers/z2m/models/wsdcgq01lm/wsdcgq01lm.go rename to attic/z2m/models/wsdcgq01lm/wsdcgq01lm.go diff --git a/src/udi/handlers/z2m/models/wsdcgq11lm/wsdcgq11lm.go b/attic/z2m/models/wsdcgq11lm/wsdcgq11lm.go similarity index 100% rename from src/udi/handlers/z2m/models/wsdcgq11lm/wsdcgq11lm.go rename to attic/z2m/models/wsdcgq11lm/wsdcgq11lm.go diff --git a/src/udi/handlers/z2m/z2m.go b/attic/z2m/z2m.go similarity index 100% rename from src/udi/handlers/z2m/z2m.go rename to attic/z2m/z2m.go diff --git a/src/udi/config-test.json b/src/udi/config-test.json index e2eb4b4..7196ec7 100644 --- a/src/udi/config-test.json +++ b/src/udi/config-test.json @@ -5,23 +5,19 @@ }, "topicMappings": [ { - "topics": [ "NR/Multisensor/+/Temperatur" ], - "handler": "SVEJ", - "id": "SVEJ0", + "topics": [ "IoT/PV/Values" ], + "handler": "PV", + "id": "PV", "config": { "databaseConnStr": "", "attributes": { - "application": "Temperature Multisensor", - "deviceSelector": "T:2", - "valueSelector": "J:$.CurrentTemperature", - "unitSelector": "C:°C" } } }, { - "topics": [ "zigbee2mqtt/+" ], - "handler": "Z2M", - "id": "Z2M", + "topics": [ "IoT/Car/Values" ], + "handler": "Car", + "id": "Car", "config": { "databaseConnStr": "", "attributes": { diff --git a/src/udi/database/database.go b/src/udi/database/database.go index fe5b0df..26e7897 100644 --- a/src/udi/database/database.go +++ b/src/udi/database/database.go @@ -124,7 +124,7 @@ func (self *DatabaseHandle) StoreMeasurement(measurement *Measurement) { // Create point pt, err := influxdb.NewPoint( - "measurement", + "observation", tags, fields, measurement.Time, diff --git a/src/udi/dispatcher/dispatcher.go b/src/udi/dispatcher/dispatcher.go index c0a8caf..7e45e58 100644 --- a/src/udi/dispatcher/dispatcher.go +++ b/src/udi/dispatcher/dispatcher.go @@ -18,8 +18,9 @@ import ( "udi/handlers/pv" "udi/handlers/svej" "udi/handlers/sver" - "udi/handlers/ttn" - "udi/handlers/z2m" + + // "udi/handlers/ttn" + // "udi/handlers/z2m" "udi/mqtt" ) @@ -35,8 +36,8 @@ func InitDispatcher() { var factory interface{} switch mapping.Handler { - case "TTN": - factory = ttn.New + // case "TTN": + // factory = ttn.New case "IoT": factory = iot.New case "PV": @@ -53,8 +54,8 @@ func InitDispatcher() { factory = locative.New case "PREP": factory = prepared.New - case "Z2M": - factory = z2m.New + // case "Z2M": + // factory = z2m.New case "Car": factory = car.New default: diff --git a/src/udi/go.sum b/src/udi/go.sum index a89b81d..c87356b 100644 --- a/src/udi/go.sum +++ b/src/udi/go.sum @@ -1,46 +1,14 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/eclipse/paho.mqtt.golang v1.4.3 h1:2kwcUGn8seMUfWndX0hGbvH8r7crgcJguQNCyp70xik= -github.com/eclipse/paho.mqtt.golang v1.4.3/go.mod h1:CSYvoAlsMkhYOXh/oKyxa8EcBci6dVkLCbo5tTC1RIE= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= -github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= -github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= -github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/eclipse/paho.mqtt.golang v1.5.0 h1:EH+bUVJNgttidWFkLLVKaQPGmkTUfQQqjOsyvMGvD6o= +github.com/eclipse/paho.mqtt.golang v1.5.0/go.mod h1:du/2qNQVqJf/Sqs4MEL77kR8QTqANF7XU7Fk0aOTAgk= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c h1:qSHzRbhzK8RdXOsAdfDgO49TtqC1oZ+acxPrkfTxcCs= +github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.5.9 h1:DkegyItji119OlcaLjqN11kHoUgZ/j13E0jkJZgD6A8= -gorm.io/driver/postgres v1.5.9/go.mod h1:DX3GReXH+3FPWGrrgffdvCk3DQ1dwDPdmbenSkweRGI= -gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg= -gorm.io/gorm v1.25.11/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=