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

[tradfri] Add support for Air Purifier #14836

Merged
merged 6 commits into from Jun 17, 2023

Conversation

vivienbo
Copy link
Contributor

@vivienbo vivienbo commented Apr 17, 2023

Description

This PR adds support for Tradfri Air Purifier (Strakvind) into the tradfri binding.
It supports:

  • changing fan mode, controlling LED and locking physical button.
  • reading current fan speed, PM2.5 ppm reading, filter uptime, time remaining before next filer check, air quality reading (aligned with Tradfri app) and a Switch to signal when filter needs to be reviewed.

Note: you will still need to run the filter review process through the Tradfri Mobile App.

Testing

Tested on OpenHAB 4.0.0-M1 and on 3.4.4.

Changelog

General matter:

  • Added documentation disambiguation Tradfri vs Dirigera
    Tradfri Air Purifier features:
  • Added Tradfri Air Purifier - fanMode and fanSpeed
  • Workable Tradfri Air Purifier basic implementation
  • Tradfri: modified fanMode type and definition
  • Tradfri Air Purifier: Added disableLed
  • Tradfri Air Purifier: Added lockPhysicalButton
  • Tradfri Air Purifier: Added airQuality data
  • Tradfri Air Purifier: Added filterCheck data
  • Tradfri Air Purifier: Added translations
  • Tradfri Air Purifier: Added filter_uptime
  • Tradfri Air Purifier: code optimization
  • Documentation for supported Air Purifier channels

Related issues:

Added Support for Tradfri Air Purifier:
* Added documentation disambiguation Tradfri vs Dirigera
* Added Tradfri Air Purifier - fanMode and fanSpeed
* Workable Tradfri Air Purifier basic implementation
* Tradfri: modified fanMode type and definition
* Tradfri Air Purifier: Added disableLed
* Tradfri Air Purifier: Added lockPhysicalButton
* Tradfri Air Purifier: Added airQuality data
* Tradfri Air Purifier: Added filterCheck data
* Tradfri Air Purifier: Added translations
* Tradfri Air Purifier: Added filter_uptime
* Tradfri Air Purifier: code optimization
* Documentation for supported Air Purifier channels
Fixes openhab#14816

Signed-off-by: Vivien Boistuaud <github@boistuaud.net>
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/tradfri-binding-support-for-air-purifiers/146119/1

@jlaur jlaur changed the title [tradfri] Added Support for Air Purifier [tradfri] Add support for Air Purifier Apr 17, 2023
@jlaur jlaur added the enhancement An enhancement or new feature for an existing add-on label Apr 17, 2023
* [tradfri] Updated README:
* Reverts unnecessary formatting changes
* Fixes centering of capabilities for non-lightning devices list
* Removes 0202, 0203 and position from lightning devices list

Signed-off-by: Vivien Boistuaud <github@boistuaud.net>
@vivienbo
Copy link
Contributor Author

Made some updates to the README to fix some formatting and content-splitting issues (8f17e0c)

@vivienbo vivienbo linked an issue Apr 20, 2023 that may be closed by this pull request
* Fixes Alphabetical order of properties
* Fixes a typo in some names

Signed-off-by: Vivien Boistuaud <github@boistuaud.net>
@vivienbo
Copy link
Contributor Author

vivienbo commented Apr 21, 2023

Proactive fixes in 7f4accf:

  • Fixes Alphabetical order of properties
  • Fixes a typo in some names

Note: Additions of the ^M endings in tradfri.properties is coming from execution of mvn i18n:generate-default-translations and probably this command hasn't been run on this file since it was added hence the increased number of changes

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! The code looks good, only a few minor comments.

* README.md alignment update
* reverting translation changes to comply with automation rules via Crowdin
* refactor things definition
* Simplify the Air Purifier thing name
* Add categories for Time and Fan
* Simplified binding constants
* reverted tradfri.properties due to formatting issues
* added default text in tradfri.properties

Signed-off-by: Vivien Boistuaud <github@boistuaud.net>
Copy link
Contributor Author

@vivienbo vivienbo left a comment

Choose a reason for hiding this comment

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

Thanks a lot @jlaur for your code review, really appreciated.
I fixed everything according to your recommendation, built and tested it to confirm it is still totally functional. New test packages for 3.4.4 and 4.0.0 have been updated in the description.

@vivienbo vivienbo requested a review from jlaur May 19, 2023 22:38
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

Before merging, perhaps you could have a look at these small findings in the README?

bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
Updates to the documentation to:
* Fix Item Types
* Fix abreviations (min -> minutes)
* Standardize `description` column of the `Channel Type ID` table
* Align the `Channel Type ID` table
* Improve the `Channels` > `Air Purifier` paragraph
* Align the non-ZLL capabilities table to similar format as ZLL One (uppercase first letter of each word; Align capabilities labels to `Channel Type ID` labels)

Signed-off-by: Vivien Boistuaud <github@boistuaud.net>
@vivienbo
Copy link
Contributor Author

vivienbo commented May 20, 2023

Hi @jlaur, I reviewed the additions to the documentation and standardization of the tables to:

  • Fix Item Types
  • Fix abreviations (min -> minutes)
  • Standardize description column of the Channel Type ID table (first letter in uppercase)
  • Align the Channel Type ID table
  • Improve the Channels > Air Purifier descriptive paragraph
  • Align the non-ZLL capabilities table to similar format as ZLL One (uppercase first letter of each word; Align capabilities labels to Channel Type ID labels for consistency)

Waiting for the build to complete and will ask for re-review.
Thanks a lot for your support.

Copy link
Contributor Author

@vivienbo vivienbo left a comment

Choose a reason for hiding this comment

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

Reviewed all changes and submitted new commit with further enhancements after rewriting the Air Purifier documentation.

@vivienbo vivienbo requested a review from jlaur May 20, 2023 11:09
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

The documentation update looks good. 👍 Only some nitty gritty last details.

bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.tradfri/README.md Outdated Show resolved Hide resolved
* Fixed for language consistency purposes

Signed-off-by: Vivien Boistuaud <github@boistuaud.net>
@vivienbo vivienbo requested a review from jlaur May 20, 2023 14:03
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

LGTM. 👍 @kaikreuzer, @cweitkamp - you are both code owners for this binding, would you like to review?

@jlaur
Copy link
Contributor

jlaur commented May 28, 2023

LGTM. 👍 @kaikreuzer, @cweitkamp - you are both code owners for this binding, would you like to review?

@kaikreuzer, @cweitkamp - gentle ping. 🙂

@jlaur
Copy link
Contributor

jlaur commented Jun 17, 2023

@kaikreuzer, @cweitkamp - I really just need to know if you'd like to have a look before merging - or not? 🙂

@kaikreuzer
Copy link
Member

Thanks for the regular pings @jlaur, I somehow missed them. I'd say you can feel free to merge if you do not hear anything back after a ping within 2 weeks. :-)
Many thanks for reviewing it!

@kaikreuzer kaikreuzer merged commit 801b860 into openhab:main Jun 17, 2023
3 checks passed
@kaikreuzer
Copy link
Member

(and of course many thanks to @vivienbo for the contribution!)

@kaikreuzer kaikreuzer added this to the 4.0 milestone Jun 17, 2023
tb4jc pushed a commit to tb4jc/openhab-addons that referenced this pull request Jun 19, 2023
* [tradfri] Added Support for Air Purifier (openhab#7)

Added Support for Tradfri Air Purifier:
* Added documentation disambiguation Tradfri vs Dirigera
* Added Tradfri Air Purifier - fanMode and fanSpeed
* Workable Tradfri Air Purifier basic implementation
* Tradfri: modified fanMode type and definition
* Tradfri Air Purifier: Added disableLed
* Tradfri Air Purifier: Added lockPhysicalButton
* Tradfri Air Purifier: Added airQuality data
* Tradfri Air Purifier: Added filterCheck data
* Tradfri Air Purifier: Added translations
* Tradfri Air Purifier: Added filter_uptime
* Tradfri Air Purifier: code optimization
* Documentation for supported Air Purifier channels
Fixes openhab#14816

Signed-off-by: Vivien Boistuaud <github@boistuaud.net>
Signed-off-by: Thomas Burri <thomas.burri@alstomgroup.com>
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Aug 9, 2023
* [tradfri] Added Support for Air Purifier (openhab#7)

Added Support for Tradfri Air Purifier:
* Added documentation disambiguation Tradfri vs Dirigera
* Added Tradfri Air Purifier - fanMode and fanSpeed
* Workable Tradfri Air Purifier basic implementation
* Tradfri: modified fanMode type and definition
* Tradfri Air Purifier: Added disableLed
* Tradfri Air Purifier: Added lockPhysicalButton
* Tradfri Air Purifier: Added airQuality data
* Tradfri Air Purifier: Added filterCheck data
* Tradfri Air Purifier: Added translations
* Tradfri Air Purifier: Added filter_uptime
* Tradfri Air Purifier: code optimization
* Documentation for supported Air Purifier channels
Fixes openhab#14816

Signed-off-by: Vivien Boistuaud <github@boistuaud.net>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
* [tradfri] Added Support for Air Purifier (openhab#7)

Added Support for Tradfri Air Purifier:
* Added documentation disambiguation Tradfri vs Dirigera
* Added Tradfri Air Purifier - fanMode and fanSpeed
* Workable Tradfri Air Purifier basic implementation
* Tradfri: modified fanMode type and definition
* Tradfri Air Purifier: Added disableLed
* Tradfri Air Purifier: Added lockPhysicalButton
* Tradfri Air Purifier: Added airQuality data
* Tradfri Air Purifier: Added filterCheck data
* Tradfri Air Purifier: Added translations
* Tradfri Air Purifier: Added filter_uptime
* Tradfri Air Purifier: code optimization
* Documentation for supported Air Purifier channels
Fixes openhab#14816

Signed-off-by: Vivien Boistuaud <github@boistuaud.net>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tradfri] Add Support for Air Purifier
4 participants