Export the sdm.devices.traits.ThermostatMode field in the metrics#6
Export the sdm.devices.traits.ThermostatMode field in the metrics#6cure wants to merge 1 commit intoklyubin:mainfrom
Conversation
set of four gauges (nest_mode_heat, nest_mode_cool, nest_mode_heatcool, nest_mode_off). Add tests for the new exported gauges.
|
I'm terribly sorry, I somehow missed this PR back in Jan when you opened it. I'll review it right now! |
klyubin
left a comment
There was a problem hiding this comment.
Looks good (same as it did on the grdl repo). Please fix the broken tests -- I left the comments on the PR to indicate what and where.
You can test by running go test ./... at the root of the repo.
It's a shame that for security reasons the Build & Test PR action doesn't add on PRs opened from another repo. It could've made easier to spot the issues.
| assert.Contains(t, w.Body.String(), `nest_ambient_temperature_celsius{id="enterprises/PROJECT_ID/devices/DEVICE_ID",label="Custom Name",room="Living Room"} 20.23999`) | ||
| assert.Contains(t, w.Body.String(), `nest_humidity_percent{id="enterprises/PROJECT_ID/devices/DEVICE_ID",label="Custom Name",room="Living Room"} 57`) | ||
| assert.Contains(t, w.Body.String(), `nest_heating{id="enterprises/PROJECT_ID/devices/DEVICE_ID",label="Custom Name",room="Living Room"} 0`) | ||
| assert.Contains(t, w.Body.String(), `nest_mode_heat{id="enterprises/PROJECT_ID/devices/DEVICE_ID",label="Custom-Name",room="Living Room"} 1`) |
There was a problem hiding this comment.
Please change the label to "Custom Name" to unbreak tests. Labels are now without the hyphen by default -- see #4. The same comment applies to the next three lines as well.
| HeatSetpointTemp: float64(19.17838), | ||
| Humidity: float64(57), | ||
| Status: "OFF", | ||
| Mode: "HEAT", |
There was a problem hiding this comment.
Please change to "HEATCOOL" to unbreak this test. "HEATCOOL" is what's in the mock Nest thermostat under test here:
pronestheus/test/testdata/nest_valid.json
Line 19 in 97bd338
|
I found out why I didn't get notified about this PR earlier -- notifications for this forked repo were off by default. I think I fixed this now. |
The mode is exported as set of four gauges (nest_mode_heat, nest_mode_cool, nest_mode_heatcool, nest_mode_off). Add tests for the new exported gauges.