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

Update Aseko to support new API #126133

Merged
merged 8 commits into from
Sep 18, 2024
Merged

Conversation

milanmeu
Copy link
Contributor

@milanmeu milanmeu commented Sep 17, 2024

Breaking change

Aseko released a new app, website and API. Some entities might not be available anymore.

Proposed change

See breaking change

Updated dependency: https://github.com/milanmeu/aioaseko/releases/tag/v1.0.0

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
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format 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.

To help with the load of incoming pull requests:

Copy link
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

Left comments, questions and suggestions :)

Comment on lines 31 to 35
AsekoBinarySensorEntityDescription(
key="water_flow",
translation_key="water_flow",
value_fn=lambda unit: unit.water_flow,
key="water_flow_to_probes",
translation_key="water_flow_to_probes",
value_fn=lambda unit: unit.water_flow_to_probes,
),
Copy link
Member

Choose a reason for hiding this comment

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

What does this mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the new API there are separate sensors for the different water flows. This sensor detects the water flow to the device's pH, chlorine and other probes.

The device may now also have water flow sensors for the inlet, outlet and filter. The latter have not yet been implemented, because they are not always configured and are only available on a limited number of devices. The may be added in a future PR.

homeassistant/components/aseko_pool_live/binary_sensor.py Outdated Show resolved Hide resolved
homeassistant/components/aseko_pool_live/binary_sensor.py Outdated Show resolved Hide resolved
homeassistant/components/aseko_pool_live/entity.py Outdated Show resolved Hide resolved
homeassistant/components/aseko_pool_live/entity.py Outdated Show resolved Hide resolved
homeassistant/components/aseko_pool_live/entity.py Outdated Show resolved Hide resolved
homeassistant/components/aseko_pool_live/entity.py Outdated Show resolved Hide resolved
homeassistant/components/aseko_pool_live/entity.py Outdated Show resolved Hide resolved
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft September 17, 2024 16:26
@milanmeu milanmeu marked this pull request as ready for review September 18, 2024 12:31
@home-assistant home-assistant bot requested a review from joostlek September 18, 2024 12:31
Copy link
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

I think we should not try to fix the unique_id problem with multiple devices in this PR. Ideally we keep the unique_ids the same and fix it properly in a followup PR (since it also needs migration so everyones long term stats are saved and automations and dashboards dont break).

For this PR to go in a patch release (2024.9.3), we should make sure the integration only exposes the entities it already did (with the same unique_id).

homeassistant/components/aseko_pool_live/sensor.py Outdated Show resolved Hide resolved
else:
self._attr_name = self._variable.name

self._attr_unique_id = f"{self._unit.serial_number}{self._variable.type}"
Copy link
Member

Choose a reason for hiding this comment

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

the old variable type used to be airTemp and waterTemp among other things. We now changed that to be air_temperature and water_temperature. Even though the api changed, we should try to maintain the same unique_id for the same datapoints.

Copy link
Contributor Author

@milanmeu milanmeu Sep 18, 2024

Choose a reason for hiding this comment

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

Fixed in 12b547e and b7ab486

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed for airTemp, free_chlorine, ph, rx, waterTemp and water_flow. I don't know what the variable.type of salinity was, so I can't be sure this wasn't changed.

@home-assistant home-assistant bot marked this pull request as draft September 18, 2024 12:42
@joostlek joostlek added this to the 2024.9.3 milestone Sep 18, 2024
@milanmeu milanmeu marked this pull request as ready for review September 18, 2024 14:00
@home-assistant home-assistant bot requested a review from joostlek September 18, 2024 14:00
@joostlek joostlek merged commit 12dbabb into home-assistant:dev Sep 18, 2024
39 of 40 checks passed
@milanmeu
Copy link
Contributor Author

👍 Thanks!

@joostlek
Copy link
Member

Thank you for being so quick ❤️

@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 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.

Add support for ASIN AQUA Home after major update.
3 participants