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 neato dismiss alert button #97572

Merged
merged 11 commits into from Aug 8, 2023
Merged

Add neato dismiss alert button #97572

merged 11 commits into from Aug 8, 2023

Conversation

maxcanna
Copy link
Contributor

@maxcanna maxcanna commented Aug 1, 2023

Breaking change

Proposed change

Adding a Dismiss Alert button to neato integration to be able to dismiss alerts preventing cleaning from start

Type of change

  • Dependency upgrade https://github.com/stianaske/pybotvac/releases/tag/v0.0.24
  • 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 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:

@home-assistant
Copy link

home-assistant bot commented Aug 1, 2023

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

Code owner commands

Code owners of neato can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign neato Removes the current integration label and assignees on the pull request, add the integration domain after the command.

@gjohansson-ST
Copy link
Member

Looks like this should be a button?

@maxcanna
Copy link
Contributor Author

maxcanna commented Aug 1, 2023

Looks like this should be a button?

Being a service you can use it however you want. Pushing a button or in an automation. I think it's more versatile

@gjohansson-ST
Copy link
Member

You can push a button in an automation.
It's still a service button.press

@maxcanna
Copy link
Contributor Author

maxcanna commented Aug 2, 2023

You can push a button in an automation. It's still a service button.press

Yeah, I know but that would be overhead and imho not conceptually correct. It's a service which exposes a functionality

@gjohansson-ST
Copy link
Member

Yeah, I know but that would be overhead and imho not conceptually correct. It's a service which exposes a functionality

Can't understand why it would be conceptually wrong? As probably there is a button or something you can click in the app to do this.
Should still be a button entity.

@maxcanna
Copy link
Contributor Author

maxcanna commented Aug 2, 2023

As probably there is a button or something you can click in the app to do this.

There's a button in the app to start the cleaning too. Nonetheless the custom cleaning is a service and not a button. I think it's better if it's a service, even for coherence.

I think it's best not to think UI first, and then interact with UI entities in code, but to think the other way around and expose something in the UI only when/if needed.

Copy link

@Rudd-O Rudd-O left a comment

Choose a reason for hiding this comment

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

Oh man this would be great.

@gjohansson-ST gjohansson-ST added the second-opinion-wanted Add this label when a reviewer needs a second opinion from another member. label Aug 3, 2023
@home-assistant
Copy link

home-assistant bot commented Aug 4, 2023

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 August 4, 2023 10:49
@joostlek
Copy link
Member

joostlek commented Aug 4, 2023

I just read the discussion and I share the opinion of @gjohansson-ST. The other service you mentioned takes arguments, so it requires more information to execute that action. In this case, it's something you can fire without extra information.

For automations, making it a service or making it a button makes no difference as both can be called and both would work. But the benefit for the button is in the usability for people who don't use it in an automation. If the button shares the same device info as the vacuum, the button will show up at the device page, allowing users to press it directly from the UI without having to create an integration or to run developer tools to call the service directly.

I found an example on my environment with Plex:
image

@gjohansson-ST gjohansson-ST removed the second-opinion-wanted Add this label when a reviewer needs a second opinion from another member. label Aug 4, 2023
@maxcanna maxcanna marked this pull request as ready for review August 4, 2023 12:23
@home-assistant home-assistant bot requested a review from joostlek August 4, 2023 12:23
Copy link
Member

@gjohansson-ST gjohansson-ST left a comment

Choose a reason for hiding this comment

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

Should be a button and not a custom service.
Please change this as already earlier said by myself and another developer.

@home-assistant home-assistant bot marked this pull request as draft August 5, 2023 12:43
@maxcanna maxcanna changed the title Add neato dismiss alert service Add neato dismiss alert button Aug 6, 2023
@maxcanna maxcanna marked this pull request as ready for review August 6, 2023 16:06
homeassistant/components/neato/button.py Outdated Show resolved Hide resolved
homeassistant/components/neato/button.py Outdated Show resolved Hide resolved
homeassistant/components/neato/button.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft August 7, 2023 11:35
@joostlek
Copy link
Member

joostlek commented Aug 7, 2023

Oh and please include a changelog for the dependency you are updating in the PR description

@maxcanna
Copy link
Contributor Author

maxcanna commented Aug 7, 2023

Oh and please include a changelog for the dependency you are updating in the PR description

I linked the release in the PR description

@maxcanna maxcanna marked this pull request as ready for review August 7, 2023 12:29
@home-assistant home-assistant bot requested a review from joostlek August 7, 2023 12:29
homeassistant/components/neato/button.py Outdated Show resolved Hide resolved
homeassistant/components/neato/button.py Outdated Show resolved Hide resolved
homeassistant/components/neato/button.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft August 7, 2023 12:56
@maxcanna maxcanna marked this pull request as ready for review August 7, 2023 15:41
@home-assistant home-assistant bot requested a review from joostlek August 7, 2023 15:42
Copy link
Member

@gjohansson-ST gjohansson-ST left a comment

Choose a reason for hiding this comment

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

Tiny remarks left and then we're good

homeassistant/components/neato/button.py Outdated Show resolved Hide resolved
homeassistant/components/neato/button.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft August 7, 2023 18:30
@maxcanna maxcanna marked this pull request as ready for review August 8, 2023 07:47
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.

Thanks!

@joostlek joostlek dismissed gjohansson-ST’s stale review August 8, 2023 12:35

Changes implemented

@joostlek joostlek merged commit 8b56e28 into home-assistant:dev Aug 8, 2023
34 checks passed
@maxcanna maxcanna deleted the add-neato-dismiss-alert-service branch August 8, 2023 13:09
@github-actions github-actions bot locked and limited conversation to collaborators Aug 9, 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.

None yet

6 participants