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

CHAD-14369 Add ezex valve sub-driver #1763

Merged
merged 1 commit into from
Nov 19, 2024
Merged

CHAD-14369 Add ezex valve sub-driver #1763

merged 1 commit into from
Nov 19, 2024

Conversation

greens
Copy link
Contributor

@greens greens commented Nov 19, 2024

This valve uses the IAS Zone Status to report low battery and does not otherwise support the PowerConfiguration cluster, which is usually used for reporting the battery. The porting work done for the DTH missed this behavior.

Check all that apply

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Summary of Completed Tests

@greens greens requested review from inasail and wkhenon November 19, 2024 00:46
Copy link

github-actions bot commented Nov 19, 2024

Test Results

   64 files  ± 0    402 suites  +1   0s ⏱️ ±0s
1 999 tests ± 0  1 999 ✅ ± 0  0 💤 ±0  0 ❌ ±0 
3 451 runs  +12  3 451 ✅ +12  0 💤 ±0  0 ❌ ±0 

Results for commit 71129df. ± Comparison against base commit 98b7d7d.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 19, 2024

File Coverage
All files 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-valve/src/sinope/init.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-valve/src/ezex/init.lua 97%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 71129df

Copy link

github-actions bot commented Nov 19, 2024

Channel deleted.

Old version of this valve use the IAS Zone Status to report low battery and do not otherwise support the PowerConfiguration cluster, which is usually used for reporting the battery. The porting work done for the DTH missed this behavior because it was removed. This adds back in the old behavior, but only for devices that do not support PowerConfiguration, which should be rare, as the old behavior is not ideal.
@greens
Copy link
Contributor Author

greens commented Nov 19, 2024

See the Jira ticket for a detailed explanation.

}
}

local function ias_zone_status_attr_handler(driver, device, zone_status, zb_rx)
Copy link
Contributor

@inasail inasail Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need emit the initial battery value to cloud?
The battery level for this device are only 3 levels?(100%, 50% 5%)

Copy link
Contributor Author

@greens greens Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went into this a bit more in the Jira ticket, but very old versions of this device only ever reported their battery status using the IAS Zone Status, which can report "low battery" or "normal battery". On the DTH, for a while, we interpreted these as 5% and 50%, but the device used a custom metadata that just reported "low" and "normal".

Eventually, it seems eZex did a firmware update and started using the PowerConfiguration cluster. (and the behavior was removed from the DTH: SmartThingsCommunity/SmartThingsPublic@1fdbf08)

So only old versions (note how the can_handle function is restricted to devices that do not support the PowerConfiguration cluster) will use this handling, which will only ever report 5% or 50%, but this matches the old DTH handling of the same.

I expect that most customers in the field have the updated firmware that uses the standard Zigbee cluster for reporting battery level, so this should only ever be a corner case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as for initial state, for these specific old devices, a read of the IAS Zone Status will occur on add or refresh that will result in a battery value of 5% or 50%.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I got it. Thank you.

Copy link
Contributor

@wkhenon wkhenon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, Steven! 🔥

@greens greens merged commit 533ede9 into main Nov 19, 2024
11 checks passed
@greens greens deleted the bugfix/CHAD-14369 branch November 19, 2024 19:32
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.

3 participants