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 Stookwijzer #84435

Merged
merged 24 commits into from
Jan 20, 2023
Merged

Add Stookwijzer #84435

merged 24 commits into from
Jan 20, 2023

Conversation

fwestenberg
Copy link
Contributor

Breaking change

Proposed change

New integration: Stookwijzer.nu.

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:

homeassistant/components/stookwijzer/binary_sensor.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/binary_sensor.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/binary_sensor.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/translations/nl.json Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/diagnostics.py Outdated Show resolved Hide resolved
fwestenberg and others added 7 commits December 22, 2022 12:58
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
@fwestenberg fwestenberg requested a review from frenck December 22, 2022 14:28
@frenck frenck removed their request for review December 22, 2022 14:41
@frenck
Copy link
Member

frenck commented Dec 22, 2022

Removed request for review, as these comments hasn't been resolved:

@fwestenberg fwestenberg requested a review from frenck December 23, 2022 09:58
@fwestenberg fwestenberg requested a review from frenck January 10, 2023 07:31
@fwestenberg
Copy link
Contributor Author

fwestenberg commented Jan 15, 2023

@frenck I believe this PR is ready now!

homeassistant/components/stookwijzer/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/const.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/strings.json Outdated Show resolved Hide resolved
homeassistant/components/stookwijzer/translations/en.json Outdated Show resolved Hide resolved
tests/components/stookwijzer/test_config_flow.py Outdated Show resolved Hide resolved
fwestenberg and others added 2 commits January 16, 2023 14:21
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
@fwestenberg
Copy link
Contributor Author

@frenck last item on the list. Without unique_id, the integration seems not to work. Is this really a problem, having lat/lon as unique_id? Docs suggest this also.

@frenck
Copy link
Member

frenck commented Jan 20, 2023

Without unique_id, the integration seems not to work. Is this really a problem, having lat/lon as unique_id?

That unique ID I'm suggesting to remove, it the unique ID for the config entry. It isn't directly used or needed and complete option. It should not influence the integration in any way (it is only used to prevent duplicates, for which lat/long is not really a fit).

This specific identifier is generally used for e.g., a device serial number, account ID, mac addresses, those kinds of things.

I'm happy to make/test and push the change in a working fashion, if you are ok with that?

../Frenck

@fwestenberg
Copy link
Contributor Author

Without unique_id, the integration seems not to work. Is this really a problem, having lat/lon as unique_id?

That unique ID I'm suggesting to remove, it the unique ID for the config entry. It isn't directly used or needed and complete option. It should not influence the integration in any way (it is only used to prevent duplicates, for which lat/long is not really a fit).

This specific identifier is generally used for e.g., a device serial number, account ID, mac addresses, those kinds of things.

I'm happy to make/test and push the change in a working fashion, if you are ok with that?

../Frenck

Yes, this would really help!

@frenck
Copy link
Member

frenck commented Jan 20, 2023

I'll dive right into it 👍

@frenck
Copy link
Member

frenck commented Jan 20, 2023

@fwestenberg I've pushed a change containing:

  • Removal of unique ID from config flow
  • Cleanup of tests because of the above
  • Adjusts the unique ID used for the sensor entity
  • Changed the title of the resulting config entry to just "Stookwijzer". This way, the frontend will merge the title & config entry title. A user can always rename it if they like. Besides, the previously used coordinates are too big to display anyways.
  • Added description in the config flow user step (so the user knows what to do with the map)
  • Fixed translations of data in the user step
  • Cleaned up translation strings
  • Small formatting changes

Let me know what you think.

../Frenck

@fwestenberg
Copy link
Contributor Author

Hi Frenck, your changes look to me! Thanks for your effort!

@frenck
Copy link
Member

frenck commented Jan 20, 2023

Added one more thing that I noticed missing in the final tests. Since it is using the enum device class, it means it also should pass the possible options the state can be in.

This allows, e.g., the automation and scripts editors to provide the end-user with a list of states to choose from:

image

If you are ok with all these changes (including this last one), please let me know. I'll finalize the adding of this integration at that point.

../Frenck

@fwestenberg
Copy link
Contributor Author

Really nice you've added this as well. I'm satisfied!

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.

Alright, thanks @fwestenberg 👍

../Frenck

@frenck frenck merged commit 29b2b67 into home-assistant:dev Jan 20, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2023
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.

2 participants