-
Notifications
You must be signed in to change notification settings - Fork 442
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
Matter Pump: improve support for OperatingMode handling #1439
Conversation
Channel deleted. |
Test Results 60 files 377 suites 0s ⏱️ Results for commit 739f0fa. ♻️ This comment has been updated with latest results. |
Minimum allowed coverage is Generated by 🐒 cobertura-action against 739f0fa |
Duplicate profile check: Passed - no duplicate profiles detected. |
b71ed77
to
4ae7212
Compare
config: | ||
values: | ||
- key: "level.value" | ||
range: [1, 100] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From Presentation team, I heard and checked when embedded config is applied, metadata cannot be applied.
local level = math.floor((ib.data.value / 254.0 * 100) + 0.5) | ||
device:emit_event_for_endpoint(ib.endpoint_id, capabilities.switchLevel.level(level)) | ||
if ib.data.value then | ||
local max_level = get_field_for_endpoint(device, LEVEL_MAX, ib.endpoint_id) or DEFAULT_MAX_LEVEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unindent this section by one tab (2 spaces)
if ib.data.value then | ||
local max_level = get_field_for_endpoint(device, LEVEL_MAX, ib.endpoint_id) or DEFAULT_MAX_LEVEL | ||
local level = math.floor((ib.data.value / max_level * MAX_CAP_SWITCH_LEVEL) + 0.5) | ||
level = math.max(level, MIN_CAP_SWITCH_LEVEL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the value we actually receive from the device, so I don't think we should change this value. If the device gives us 0, then that should be considered valid if that is how the device works
Similar merge was made earlier today (6/26). Closing this PR. |
No description provided.