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

Matter Pump: improve support for OperatingMode handling #1439

Closed
wants to merge 4 commits into from

Conversation

hcarter-775
Copy link
Contributor

No description provided.

@hcarter-775 hcarter-775 requested a review from ctowns June 12, 2024 21:09
Copy link

github-actions bot commented Jun 12, 2024

Channel deleted.

Copy link

github-actions bot commented Jun 12, 2024

Test Results

   60 files    377 suites   0s ⏱️
1 819 tests 1 819 ✅ 0 💤 0 ❌
3 157 runs  3 157 ✅ 0 💤 0 ❌

Results for commit 739f0fa.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jun 12, 2024

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 739f0fa

Copy link

Duplicate profile check: Passed - no duplicate profiles detected.

config:
values:
- key: "level.value"
range: [1, 100]
Copy link
Collaborator

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.

Base automatically changed from matter-pump to main June 26, 2024 21:36
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
Copy link
Contributor

@ctowns ctowns Jun 26, 2024

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)
Copy link
Contributor

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

@hcarter-775
Copy link
Contributor Author

Similar merge was made earlier today (6/26). Closing this PR.

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

3 participants