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 Overkiz AtlanticPassAPCHeatingAndCoolingZone #78659

Conversation

nyroDev
Copy link
Contributor

@nyroDev nyroDev commented Sep 17, 2022

Breaking change

Proposed change

Implement AtlanticPassAPCHeatingAndCoolingZone with minimal but functionnal features.
AtlanticPassAPCHeatingAndCoolingZone is an heating system circuit managed by an Atlantic heat pump.
A corresponding temperature sensor is also attached to the heat pump and is used here in order to retrieve the current temperature of the heating zone.
1 Atlantic heat pump could have multiple AtlanticPassAPCHeatingAndCoolingZone attached.

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

It tested it on my real devices at home, which doesn't support cooling.
The features I implmented seem to work so far

I also added the async_execute_commands in the Overkiz executor in order to be able to execute multiple commands at once.
I did it because the regular web interface of Somfy do that.
It works great, but the cancel feature is not implemented.
As fas I async_execute_commandsI checked and it seems it's not used in any place for the single command execution

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.

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:

@homeassistant
Copy link
Contributor

Hi @nyroDev,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@probot-home-assistant
Copy link

Hey there @iMicknl, @vlebourl, @tetienne, mind taking a look at this pull request as it has been labeled with an integration (overkiz) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@nyroDev nyroDev mentioned this pull request Sep 17, 2022
23 tasks
Copy link
Contributor

@bachya bachya left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

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.

Looks good. Some minor remarks.

@nyroDev
Copy link
Contributor Author

nyroDev commented Sep 23, 2022

Hi @iMicknl @tetienne,
could you tell me if I need to do more or change how async_execute_commands is working in order to merge this PR?

@nyroDev
Copy link
Contributor Author

nyroDev commented Oct 5, 2022

This PR is now simpler, multiple command calls have been splitted into #79576 as suggested by @iMicknl
This PR do only 1 thing now : add a new entity to overkiz.
It works great for me.
The multiple calls optimization will be done in the other PR later on.

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.

Looks good @nyroDev! Good to have it simplified and the other code improvements in another PR.

Comment on lines +31 to 34
self.base_device_url = split_device_url[0]
if len(split_device_url) == 2:
self.index_device_url = split_device_url[1]
self.executor = OverkizExecutor(device_url, coordinator)
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this code do? Tbh, I don't find this code very clean / readable. And it seems that self.index_device_url is not typed / having None as default.

Copy link
Contributor

Choose a reason for hiding this comment

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

In other devices, like somfy_thermostat for instance, we use a constant:

def __init__(
self, device_url: str, coordinator: OverkizDataUpdateCoordinator
) -> None:
"""Init method."""
super().__init__(device_url, coordinator)
self.temperature_device = self.executor.linked_device(
TEMPERATURE_SENSOR_DEVICE_INDEX
)

I think it might be clearer an less prone to error than doing n+1 as you do here

        # Temperature sensor use the same base_device_url and use the n+1 index
        self.temperature_device = self.executor.linked_device(
            int(self.index_device_url) + 1
        )

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 type of device don't work like that.
We have to use the climate device index and search for n+1 index, which will be the temperature sensor.
The n+1 is required

Copy link
Member

Choose a reason for hiding this comment

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

Does it resolves the conversation ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When this PR is merged and published, this code will be updated.

Copy link
Member

@Quentame Quentame Nov 4, 2022

Choose a reason for hiding this comment

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

OK, so, for now we are keeping it like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's working like this, it could be merged as it is.
Up to @iMicknl to decide I guess.

Copy link
Member

@Quentame Quentame left a comment

Choose a reason for hiding this comment

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

few comments, otherwise goob job !

Copy link
Member

@Quentame Quentame left a comment

Choose a reason for hiding this comment

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

Make sure this PR contains the latest ha-tahoma feature/fix

nyroDev and others added 4 commits November 3, 2022 20:59
Co-authored-by: Quentame <polletquentin74@me.com>
…s_apc_heating_and_cooling_zone.py

Co-authored-by: Quentame <polletquentin74@me.com>
…s_apc_heating_and_cooling_zone.py

Co-authored-by: Quentame <polletquentin74@me.com>
Co-authored-by: Quentame <polletquentin74@me.com>
@nyroDev
Copy link
Contributor Author

nyroDev commented Nov 3, 2022

Make sure this PR contains the latest ha-tahoma feature/fix

@Quentame This PR include almost everyt features that are present in ha-tahoma.
The min and max temperature are note present because on my live example, this states does not exists.

Also the coding styles and the way to retrieve temparatures devices have been updated to match how it's done in others integrations here.

There is a pending PR in pyoverkiz to improve this a little bit.

Copy link
Member

@Quentame Quentame left a comment

Choose a reason for hiding this comment

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

Good job, thanks ! 🎉

Waiting one conversation resolution before merging.

@Quentame Quentame merged commit 1a5eeb2 into home-assistant:dev Nov 4, 2022
@Quentame
Copy link
Member

Quentame commented Nov 4, 2022

@nyroDev Can you explain what is a AtlanticPassAPCHeatingAndCoolingZone device IRL in the "Proposed change" section of the description of the PR ?

As it will be used for the release notes, it will be more understandable for everyone.

@nyroDev
Copy link
Contributor Author

nyroDev commented Nov 4, 2022

@nyroDev Can you explain what is a AtlanticPassAPCHeatingAndCoolingZone device IRL in the "Proposed change" section of the description of the PR ?

As it will be used for the release notes, it will be more understandable for everyone.

Updated, let me know if that's ok for you.

@Quentame
Copy link
Member

Quentame commented Nov 4, 2022

@nyroDev Can you explain what is a AtlanticPassAPCHeatingAndCoolingZone device IRL in the "Proposed change" section of the description of the PR ?
As it will be used for the release notes, it will be more understandable for everyone.

Updated, let me know if that's ok for you.

Nice ! 👌

@nyroDev nyroDev deleted the overkiz/atlantic_pass_apc_heating_and_cooling_zone branch November 4, 2022 09:49
@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants