Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change read scheme to allow multiple readings of the same type #181

Merged
merged 2 commits into from
Jun 22, 2018

Conversation

edaniszewski
Copy link
Contributor

fixes #177

The need for this was made known by updating the modbus-ip plugin, where the eGauge device will have multiple voltage readings. Previously, only one would show up because the other readings would get overridden in the dict. Now, the reading data is a list so multiple readings of the same type can coexist, e.g.

edaniszewski ~ ➜ curl localhost:5000/synse/2.1/read/rack-1/board-1/03375594c959ddafa53ab057d78e5f59
{
  "kind":"input_register",
  "data":[
    {
      "value":122.836,
      "timestamp":"2018-06-22T17:20:23.1707345Z",
      "unit":{
        "symbol":"V",
        "name":"volt"
      },
      "type":"voltage",
      "info":"Leg 1 to neutral RMS voltage"
    },
    {
      "value":2.304,
      "timestamp":"2018-06-22T17:20:23.2169122Z",
      "unit":{
        "symbol":"V",
        "name":"volt"
      },
      "type":"voltage",
      "info":"Leg 2 to neutral RMS voltage"
    },
    {
      "value":122.765,
      "timestamp":"2018-06-22T17:20:23.2510255Z",
      "unit":{
        "symbol":"V",
        "name":"volt"
      },
      "type":"voltage",
      "info":"Leg 1 to Leg 2 RMS voltage"
    }
  ]
}

pinging @MatthewHink @Kontazler @hoanhan101 since I believe you are all using this sdk1.0 branch of synse server for various things.

…he same device (e.g. a single device might provide multiple voltage readings)
@MatthewHink
Copy link
Contributor

Thanks - I may need this for humidity/temperature and the fan controllers.

@codecov
Copy link

codecov bot commented Jun 22, 2018

Codecov Report

Merging #181 into sdk1.0 will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           sdk1.0     #181   +/-   ##
=======================================
  Coverage   81.42%   81.42%           
=======================================
  Files          44       44           
  Lines        1276     1276           
=======================================
  Hits         1039     1039           
  Misses        237      237
Impacted Files Coverage Δ
synse/scheme/read.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77d32b7...1c315d0. Read the comment docs.

@edaniszewski
Copy link
Contributor Author

@MatthewHink yeah, it'll definitely change how reading data is accessed, e.g. in auto-fan. its basically the difference between checking a key and iterating through and checking a field, so it should be pretty minor.

@edaniszewski edaniszewski merged commit 4f61af6 into sdk1.0 Jun 22, 2018
@edaniszewski edaniszewski deleted the read-scheme-change branch June 22, 2018 17:44
edaniszewski added a commit that referenced this pull request Jul 2, 2018
* start to update internal grpc client for sdk1.0 changes

* update internal grpc client handling

* add capabilities route

* update models, update tests

* update plugins route to include metadata and health info

* update plugin registration flow. still needs to be cleaned up, tests need to be updated/added

* add support for service discovery via kubernetes service endpointswith labels

* update deployment configurations, fix bug in unix registration

* update tests for plugin flow changes

* update api docs

* use new synse_grpc package

* more doc updates, fix serialization bug

* user guide docs update

* update user guide docs

* fix bug where no returned reading would cause failure (#178)

* Change read scheme to allow multiple readings of the same type (#181)

* update read scheme to allow multiple readings of the same type from the same device (e.g. a single device might provide multiple voltage readings)

* update api docs

* Fix build args for old docker versions (#183)

* fix build args for old docker version

* update comment

* scan output should have type, not kind (#186)

* final updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants