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

add maileke air quality detector #1850

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

Conversation

thinkaName
Copy link
Contributor

@thinkaName thinkaName commented Jan 3, 2025

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

Copy link

github-actions bot commented Jan 3, 2025

Duplicate profile check: Passed - no duplicate profiles detected.

Copy link

github-actions bot commented Jan 3, 2025

Copy link

github-actions bot commented Jan 3, 2025

Test Results

   65 files    405 suites   0s ⏱️
2 015 tests 2 015 ✅ 0 💤 0 ❌
3 480 runs  3 480 ✅ 0 💤 0 ❌

Results for commit e93d1dd.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 3, 2025

File Coverage
All files 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-air-quality-detector/src/MultiIR/init.lua 93%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against e93d1dd

id = 0x0000,
value_type = data_types.Uint16,
},
pm1_0 = {
Copy link

Choose a reason for hiding this comment

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

Are you sure that this attribute is pm1.0? The cluster ID is standard and the attributes are usually MeasuredValue, MinMeasuredValue, MaxMeasuredValue and sometimes 0x0003 for Tolerance.

Especially when you already call the cluster pm2.5, the attributes shouldn't be pm1.0 and so on.

capabilities.veryFineDustHealthConcern,
capabilities.veryFineDustSensor,
capabilities.dustHealthConcern,
capabilities.fineDustSensor,
Copy link

Choose a reason for hiding this comment

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

Redundant.

end
end

local function pm2_5_attr_handler(cap,Concern,good,bad)
Copy link

@ldeora ldeora Jan 3, 2025

Choose a reason for hiding this comment

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

This should be split into separate handlers - IF the device even has pm1.0 and pm10 measurement.

},
[custom_clusters.pm2_5.id] = {
[custom_clusters.pm2_5.attributes.pm2_5.id] = pm2_5_attr_handler(capabilities.fineDustSensor.fineDustLevel,capabilities.fineDustHealthConcern.fineDustHealthConcern,75,115),
[custom_clusters.pm2_5.attributes.pm1_0.id] = pm2_5_attr_handler(capabilities.veryFineDustSensor.veryFineDustLevel,capabilities.veryFineDustHealthConcern.veryFineDustHealthConcern,100,0),
Copy link

Choose a reason for hiding this comment

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

What are these values 100 and 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the comparative value of the level of quality

- id: refresh
version: 1
categories:
- name: AirQualityDetector
Copy link

Choose a reason for hiding this comment

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

Without a dashboard, the device tile would look like a temperature sensor with an icon of an air quality sensor.

end
end

local maileke_sensor = {
Copy link

Choose a reason for hiding this comment

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

With a life cycle handler ( lifecycle_handlers ) for init, added or do_configure, you could actually configure the clusters. Without configuration, the device won't send anything or fire messages at a rate of 1 per second.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not a sleep end device

@ldeora
Copy link

ldeora commented Jan 3, 2025

Here's an example of a driver with custom clusters:

https://github.com/ldeora/SmartThingsEdgeDrivers/tree/main/IKEA-VINDSTYRKA-TVOC

You can see how you can configure them (the laziest way), some naming conventions, how you can change the device tile and much more.

This is a very friendly and helpful community where you can discuss these things before you submit a pull request:

https://community.smartthings.com/c/developer-programs/85

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.

2 participants