Skip to content

generic_zigbee_sensor_improvement #2093

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pInksenberg
Copy link
Contributor

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

Refactoring zigbee-sensor driver, and adding support for tuya zigbee devices.

Summary of Completed Tests

Copy link

Duplicate profile check: Passed - no duplicate profiles detected.

Copy link

github-actions bot commented Apr 23, 2025

Test Results

   67 files    430 suites   0s ⏱️
2 216 tests 2 216 ✅ 0 💤 0 ❌
3 773 runs  3 773 ✅ 0 💤 0 ❌

Results for commit b81729b.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 23, 2025

tuya_coverage.xml

File Coverage
All files 99%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/Unofficial/tuya/src/tuya-curtain/init.lua 96%

zigbee-sensor_coverage.xml

File Coverage
All files 100%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/Unofficial/tuya/src/tuya-curtain/init.lua 96%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against b81729b

@pInksenberg pInksenberg force-pushed the generic_zigbee_sensor_improvement branch from 0f03911 to 21f22c9 Compare April 23, 2025 08:36
@pInksenberg pInksenberg force-pushed the generic_zigbee_sensor_improvement branch 4 times, most recently from 7af243e to 9267b81 Compare April 24, 2025 06:37
@pInksenberg pInksenberg force-pushed the generic_zigbee_sensor_improvement branch from 9267b81 to b81729b Compare April 24, 2025 09:44
Comment on lines +22 to +23
- 0xfe00 # EZVIZ private cluster
- 0xfe05 # EZVIZ private cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

we usually capitalize the letters in our hex

Comment on lines +66 to +72
local generate_event_from_emergency = function(driver, device)
device:emit_event(capabilities.button.button.pushed({ state_change = true }))
end

local ias_ace_emergency_handler = function(driver, device)
generate_event_from_emergency(driver, device)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

these functions can be consolidated

Comment on lines +26 to +47
local generate_event_from_zone_status = function(driver, device, zone_status, zb_rx)
local event
if zone_status:is_alarm1_set() or zone_status:is_alarm2_set() then
event = capabilities.contactSensor.contact.open()
else
event = capabilities.contactSensor.contact.closed()
end
if event ~= nil then
device:emit_event_for_endpoint(
zb_rx.address_header.src_endpoint.value,
event)
end
end


local ias_zone_status_attr_handler = function(driver, device, zone_status, zb_rx)
generate_event_from_zone_status(driver, device, zone_status, zb_rx)
end

local ias_zone_status_change_handler = function(driver, device, zb_rx)
generate_event_from_zone_status(driver, device, zb_rx.body.zcl_body.zone_status, zb_rx)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

are we overwriting the defaults somewhere that makes it necessary to redefine them here?

Copy link
Contributor

@greens greens left a comment

Choose a reason for hiding this comment

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

I'd appreciate if we could separate the zigbee generic sensor driver from the Tuya drivers.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants