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 Daikin Madoka thermostat integration #45314

Closed
wants to merge 15 commits into from

Conversation

mduran80
Copy link
Contributor

@mduran80 mduran80 commented Jan 19, 2021

Breaking change

Proposed change

Add integration for Daikin BRC1H bluetooth thermostats (a.k.a madoka)

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)
  • 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.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@mduran80
Copy link
Contributor Author

Black and isort were stuck in a loop, each of them modifying the other changes so I had to disable isort. Any solution for this?

mduran80 added a commit to mduran80/core that referenced this pull request Jan 19, 2021
The pre-commit hook gets stuck in a file formatting loop where black and isort modify each other results. According to the isort webpage, the option --profile black has to be used to enhance compatibility. This has been run successfully in my local and has solved the loop.

See:
home-assistant#45318
home-assistant#45314
cgarwood pushed a commit that referenced this pull request Jan 20, 2021
…ck (#45321)

The pre-commit hook gets stuck in a file formatting loop where black and isort modify each other results. According to the isort webpage, the option --profile black has to be used to enhance compatibility. This has been run successfully in my local and has solved the loop.

See:
#45318
#45314
@mduran80
Copy link
Contributor Author

@frenck can you have a look at the isort error, please?

.pre-commit-config.yaml Outdated Show resolved Hide resolved
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Some comments to get you started.

Additional:

  • There is an image in this PR? Please remove it.
  • The Configuration Flow requires tests, with a 100% coverage

I cannot reproduce the black/isort issues you've been pointing out. The changes isort wants to make (as shown in the CI), are correct and the same in my local development environment. black doesn't trigger on the changes isort created on my end either.

Please make sure you have the correct version of black & isort.

homeassistant/components/daikin_madoka/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/daikin_madoka/climate.py Outdated Show resolved Hide resolved
homeassistant/components/daikin_madoka/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/daikin_madoka/const.py Outdated Show resolved Hide resolved
homeassistant/components/daikin_madoka/sensor.py Outdated Show resolved Hide resolved
@mduran80 mduran80 force-pushed the daikin-madoka-integration branch 4 times, most recently from eeaa069 to a40e85c Compare January 23, 2021 19:50
@mduran80 mduran80 requested a review from frenck January 24, 2021 08:04
@mduran80
Copy link
Contributor Author

Hey @frenck ! Could you have another look at this? I guess you must be busy with other stuff, but this is my first PR (noob) and I don't know if I have to ping you or.. just wait? Thank you!

@MartinHjelmare MartinHjelmare added this to Incoming in New Integrations Feb 23, 2021
@frenck frenck removed their request for review April 9, 2021 15:54
Copy link
Contributor

@iMicknl iMicknl left a comment

Choose a reason for hiding this comment

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

I had a quick look, hopefully it is helpful :-)

def device_info(self):
"""Return a device description for device registry."""

return self.dev_info
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this is allowed, since you don't specify all properties yourselves. Are you sure it only contains valid device properties? Best would be to do it as the example below, where you can always pull the info from self.dev_info.

   return {
            "identifiers": {
                # Serial numbers are unique identifiers within a specific domain
                (hue.DOMAIN, self.unique_id)
            },
            "name": self.name,
            "manufacturer": self.light.manufacturername,
            "model": self.light.productname,
            "sw_version": self.light.swversion,
            "via_device": (hue.DOMAIN, self.api.bridgeid),
        }

See https://developers.home-assistant.io/docs/device_registry_index/#device-properties

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the properties may no be fully aligned. When I reviewed what was being done with them I just thought it would do no harm to let HA list only those that match. I will change it to the supported properties as suggested.

homeassistant/components/daikin_madoka/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/daikin_madoka/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/daikin_madoka/climate.py Outdated Show resolved Hide resolved
homeassistant/components/daikin_madoka/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/daikin_madoka/manifest.json Outdated Show resolved Hide resolved
Updated for lint tests
Removed climate platform and unused variables
Force CI workflow run
Clean up
Fixed discover devices wrong parameters
Linter fixes
Ensure unique id is set and early abort
Added config flow tests
Remove platform till next PR
Updated requirements
Bleak error workaround
Bleak init error workaround
@frenck frenck self-requested a review July 21, 2021 11:52
@github-actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 20, 2021
@github-actions github-actions bot closed this Oct 27, 2021
Dev automation moved this from Needs review to Cancelled Oct 27, 2021
New Integrations automation moved this from Incoming to Cancelled Oct 27, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Cancelled
New Integrations
  
Cancelled
Development

Successfully merging this pull request may close these issues.

None yet

4 participants