Aligned handlers and fields in value magnitude and added tests#3111
Conversation
|
Channel deleted. |
Test Results 73 files ± 0 536 suites - 2 0s ⏱️ ±0s Results for commit e566c1b. ± Comparison against base commit 4a06ba8. This pull request removes 2 and adds 13 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against e566c1b |
e2b0384 to
08a32b8
Compare
| local setpoint_limit_handler = function(limit_type) | ||
| return function(driver, device, limit) | ||
| device:set_field(limit_type, limit.value, {persist = true}) | ||
| device:set_field(limit_type, limit.value / 100.0, {persist = true}) |
There was a problem hiding this comment.
While this will fix it for future devices, this value is already persisted on existing devices, so even though I think this change makes more sense in a vacuum, for this fix, I think we need to keep persisting in centidegrees (and comment that we are doing such) and then do this division on the checks. We'll have to update the DEFAULT values as well
aeac47a to
4254ba3
Compare
55f504a to
2376ac9
Compare
2376ac9 to
d8fc967
Compare
| ) | ||
|
|
||
| test.register_message_test( | ||
| "MinHeatSetpointLimit report stores device field", |
There was a problem hiding this comment.
What is actually being tested here? Maybe needs to be a coroutine test to check device fields with get_field
There was a problem hiding this comment.
That the fields were actually being handled. I verified that it breaks the tests if the handlers are not set, but you're right. I should just check those values for more sanity while im at it. Updated
Fixed a bug where
(min|max)(Heat|Cool)SetPointwas being set in centidegrees and then being used to clamp a value in degrees causing the clamped value to have an Int16 overflow error when then tried to scale to centidegrees.Mutant testing: Failing without the
/ 100.0fix/update.