-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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
Ask for PIN in Husqvarna Autmower BLE integration #135440
base: dev
Are you sure you want to change the base?
Conversation
All Automowers are setup with a 4 digit PIN. Depending the the model of the Automower and the security level set on the device by the user the PIN is required at boot and when performing certain operations. The current Home Assistant integration doesn't require a PIN for certain models. It seems like higher security levels or certain models always require a PIN though. So the integration currently doesn't work for all models or configurations. As such, let's request a PIN from users when setting up the integration so that we can use that for communicating with the mower. This should make the integration more robust for a range of different models and security levels as we can send the PIN as part of the BLE setup. Fixes: home-assistant#131321 Signed-off-by: Alistair Francis <alistair@alistair23.me>
d7a234e
to
86f32fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why do we need this now and what happens to the old config entry data for people who already have this set up?
await self.async_set_unique_id(self.address, raise_on_progress=False) | ||
self._abort_if_unique_id_configured() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have the unique id set
return await self.async_step_confirm() | ||
return await self.async_step_bluetooth_confirm() | ||
|
||
async def async_step_bluetooth_confirm( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, Do we now have
Discovery -> bluetooth_confirm form -> confirm form -> create_entry?
User form -> confirm form -> create_entry?
Let's try to remove that confirm now, since clicking submit
on the page to fill in the PIN sounds like a good enough confirm to me. Same for the user flow.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Oh I read the description now (bad habit lol). So I think instead of marking this a breaking change and have people setup their device again, let's create a way to update their configuration. There are 2 ways to do this and I need some more information about the PIN to know which one makes more sense:
|
Someone just told me that the PIN can be changed, so I would recommend using a reauth flow to allow the user to provide the new PIN |
Breaking change
The integration now requires the AutoMower PIN when being setup. This ensure Home Assistant can communicate with more models of Mowers and with higher security levels.
Proposed change
All Automowers are setup with a 4 digit PIN. Depending the the model of the Automower and the security level set on the device by the user the PIN is required at boot and when performing certain operations.
The current Home Assistant integration doesn't require a PIN. It seems like higher security levels or certain models always require a PIN though. So the integration currently doesn't work for all models or configurations.
As such, let's request a PIN from users when setting up the integration so that we can use that for communicating with the mower. This should make the integration more robust for a range of different models and security levels as we can send the PIN as part of the BLE setup.
Fixes: #131321
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: