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 Danfoss Ally thermostat and derivatives to ZHA #86907

Merged
merged 153 commits into from
Jun 12, 2024

Conversation

Caius-Bonus
Copy link
Contributor

@Caius-Bonus Caius-Bonus commented Jan 29, 2023

Proposed change

This adds support for the proprietary attributes of the Danfoss Ally thermostat and derivatives.

It does this in 5 parts:

  1. It implements: the (binary) sensor, select, switch and number entities.
    a. It implements certain sensors using a more appropriate type than used in the zha-quirks (if changed in the zha-quirks, no changes are required in homeassistant core though).
  2. It adds english strings for the entities.
  3. It adds the BitMapSensor Class to be used for bitmap sensors.
  4. It adds tests for the BitMap Sensor
  5. It adds manufacturer specific cluster handlers for the Danfoss diagnostic, userinterface and thermostat clusters.

This makes it possible to fully control the Thermostatic Radiator Valves just like with Zigbee2MQTT.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

…ermostat.pi_heating_demand and thermostat_ui.keypad_lockout
@home-assistant

This comment was marked as resolved.

@home-assistant
Copy link

Hey there @dmulcahey, @Adminiuga, @puddly, mind taking a look at this pull request as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of zha can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign zha Removes the current integration label and assignees on the issue, add the integration domain after the command.

@MartinHjelmare MartinHjelmare changed the title ZHA integration: Add support for attributes from Danfoss Ally thermostat and derivatives Add support for Danfoss Ally thermostat and derivatives to ZHA Jan 30, 2023
@Caius-Bonus Caius-Bonus marked this pull request as draft February 1, 2023 12:29
@Caius-Bonus
Copy link
Contributor Author

I'll turn this into a draft for now, because I still need to improve some things both here and in zha-device-handlers.

@Caius-Bonus Caius-Bonus marked this pull request as ready for review April 24, 2024 16:38
@Caius-Bonus
Copy link
Contributor Author

Ready for merge finally.

@Hoffmann77
Copy link

Any chance this could be merged soon?

@Mikaka27
Copy link

Is change requested still applicable to current code?

@Caius-Bonus
Copy link
Contributor Author

Caius-Bonus commented May 27, 2024

It looks like all the changes still add functionality and don't remove anything. It also looks like all new code is written the way it should be.

All tests seem like they still pass and I have been running the code for over a month without any issues.

Seems like it is good to merge.

EDIT: @Mikaka27 you mean the review by edenhaus? That is for a very old version and was just a request for rebasing. Has nothing to do with the current code. I thought you meant the PR itself.

@Mikaka27
Copy link

It looks like all the changes still add functionality and don't remove anything. It also looks like all new code is written the way it should be.

All tests seem like they still pass and I have been running the code for over a month without any issues.

Seems like it is good to merge.

EDIT: @Mikaka27 you mean the review by edenhaus? That is for a very old version and was just a request for rebasing. Has nothing to do with the current code. I thought you meant the PR itself.

Yes I meant the change request by edenhaus.

@Caius-Bonus
Copy link
Contributor Author

Caius-Bonus commented May 30, 2024

@edenhaus Could you maybe remove the change requested? It might make it look like I didn't address all reviews yet.

Also, could somebody remove the "breaking-change" label? It is not a breaking change, it only adds functionality. The label was erroneously added, because I thought the changes in zha-quirks were considered breaking changes (even if they were considered breaking, that has nothing to do with this PR and also was already merged over a month ago).

@puddly
Copy link
Contributor

puddly commented Jun 11, 2024

This PR looks good to me. I've made a small PR (Caius-Bonus#4) to @Caius-Bonus's branch to remove code out of __init__.

@TheJulianJES You left a few review comments regarding __init__. Would this take care of them?

@TheJulianJES
Copy link
Member

From a quick look, yeah. I hoped that we could get this into quirks v2 instead, as it should all be possible now, but we can can also add it here I guess.

@puddly puddly dismissed edenhaus’s stale review June 11, 2024 21:03

No longer relevant

@Caius-Bonus
Copy link
Contributor Author

Caius-Bonus commented Jun 12, 2024

@puddly Thanks, I merged your PR.

@TheJulianJES I changed the description of my PR to better reflect all changes. This PR needs to happen to at least add the BitMapSensor to HomeAssistant Core. When changing this device to Quirks V2, BitMapSensor would also need to be integrated into Quirks V2. Also, many parts of this device deviate from other devices, which means doing this in Quirks V2 would require multiple other changes to Quirks V2.

I think it would be best to merge this PR. Then I can make a new Pull Requests to convert it to Quirks V2. This way the device works for all other users and it will be possible to change the device to Quirks V2 at a slower pace (which I think is going to take multiple PRs, because of the many deviations of this device).

Also: can somebody remove the "breaking-change" label. See #86907 (comment)

@puddly puddly merged commit 7f7128a into home-assistant:dev Jun 12, 2024
24 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants