Skip to content

Commit

Permalink
Merge pull request #1635 from weichou1229/issue-931
Browse files Browse the repository at this point in the history
feat: Allow store reading value as null
  • Loading branch information
cloudxxx8 authored Oct 7, 2024
2 parents 0ef7f81 + f85ffc9 commit e658506
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion example/cmd/device-simple/Attribution.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ https://github.com/oklog/ulid/blob/main/LICENSE
github.com/opentracing/opentracing-go (Apache-2.0) https://github.com/opentracing/opentracing-go
https://github.com/opentracing/opentracing-go/blob/master/LICENSE

github.com/openziti/channel/v2 (Apache-2.0) https://github.com/openziti/channel
github.com/openziti/channel/v3 (Apache-2.0) https://github.com/openziti/channel
https://github.com/openziti/channel/blob/main/LICENSE

github.com/openziti/edge-api (Apache-2.0) https://github.com/openziti/edge-api
Expand Down Expand Up @@ -428,3 +428,6 @@ https://github.com/googleapis/go-genproto/blob/main/LICENSE

nhooyr.io/websocket (ISC) https://github.com/nhooyr/websocket
https://github.com/nhooyr/websocket/blob/master/LICENSE.txt

gopkg.in/go-jose/go-jose.v2 (Apache 2.0) - https://github.com/go-jose/go-jose
https://github.com/go-jose/go-jose/blob/v2.6.3/LICENSE
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.23
require (
github.com/OneOfOne/xxhash v1.2.8
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.60
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.46
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.49
github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.37
github.com/google/uuid v1.6.0
github.com/hashicorp/go-multierror v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.60 h1:4EnGLJIA285iPUVKsth
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.60/go.mod h1:hDdB2Te8stOkIIyCrKa1tXvHlZLvAZ3luiAz6Qz6Cr8=
github.com/edgexfoundry/go-mod-configuration/v3 v3.2.0-dev.17 h1:eNLGThT5fYtFLSrr6vtvHV92cm5IohJzwSRYcd5pvtg=
github.com/edgexfoundry/go-mod-configuration/v3 v3.2.0-dev.17/go.mod h1:va3l+Nri1KijDM5KItsaYrwUSG3Nhj/4EDvR4uB+Jds=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.46 h1:rivgaOszQTr568qpcJYamChuPcfR+qmmyzurADn/tNw=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.46/go.mod h1:8MSv8MFJnUdjZUEfPpxEMQUskv5VENJQkKsroE7YKUM=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.49 h1:uBI0nA3oO9P2MWBR1Tcn/543u4GFfWXd4J9Gii6CB1k=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.49/go.mod h1:MLk37/79M26+bZr3IptNZuYmQBEVbXwzDp1VHQkFhIk=
github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.37 h1:nWbivwRCUjIcpLkZKR64P6YfAColwKYwduSG3wsePAU=
github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.37/go.mod h1:zz7dUOhkt56VBdMGoRIec8ZO7C0zKarZQl9qZ06ycE0=
github.com/edgexfoundry/go-mod-registry/v3 v3.2.0-dev.16 h1:vG6cI1LU8QLpzUXYleYuVyqbpeYghLF3Jj6afcaUCHA=
Expand Down
9 changes: 6 additions & 3 deletions internal/autoevent/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@ func TestCompareReadings(t *testing.T) {
e, err := NewExecutor("device-test", autoEvent, pool)
require.NoError(t, err)

value1 := "1"
value2 := "2"
value3 := "3"
testReadings := []dtos.BaseReading{{ResourceName: "r1"}, {ResourceName: "r2"}}
testReadings[0].ValueType = common.ValueTypeInt8
testReadings[0].Value = "1"
testReadings[0].Value = &value1
testReadings[0].ValueType = common.ValueTypeInt8
testReadings[1].Value = "2"
testReadings[1].Value = &value2

firstReadings := testReadings

readingsValueChanged := make([]dtos.BaseReading, len(firstReadings))
copy(readingsValueChanged, firstReadings)
readingsValueChanged[1].Value = "3"
readingsValueChanged[1].Value = &value3

readingsResourceChanged := make([]dtos.BaseReading, len(readingsValueChanged))
copy(readingsResourceChanged, readingsValueChanged)
Expand Down

0 comments on commit e658506

Please sign in to comment.