sonicare-ble-hacs icon indicating copy to clipboard operation
sonicare-ble-hacs copied to clipboard

Anyway to decrease the startup time of the integration? Stalls and warnings if a previously setup brush is in sleep/offline/dead

Open SpartanTech opened this issue 2 years ago • 4 comments

I LOVE that you took the time to create this integration. Works perfect with my Oral B integration so now everyone in the family can utilize it both brands. The kids use a Sonicare4kids brush. It was setup okay, but if its ever offline, sleeping, or dead, the integration spams the logbook on trying to reconnect. On a home assistant restart, if the brush is sleeping, it delays the startup by a minute

image

Not only that, but it appears even after home assitant loads, the integration keeps trying over and over again to reach the brush instead of first listening to a brush advertisement then trying

SpartanTech avatar Jun 21 '23 20:06 SpartanTech

That's a no-go in my eyes. Custom integrations blocking Core starts need to urgently be fixed (or uninstalled).

bcutter avatar Aug 28 '23 10:08 bcutter

Hi @GrumpyMeow ,

Is it possible to check the reason behind the long startup time?

micro521 avatar Feb 15 '24 09:02 micro521

Hi all, i took some time to look into the said issues. I've based the implementation on the ld2410-ble code. I put the ld2410-code next to the Sonicare-code and there is no difference.

The toothbrushed do send advertisements, but every time the same data. Unfortuntatly advertisements with the same data gets ignored by Home Assistant. To work around this, a connection needs to be made with the toothbrush even without receiving an advertisement. This as an advertisement might already be received before the toothbrush is configured.

I will look into it some more, maybe i find a better solution.

GrumpyMeow avatar Feb 23 '24 19:02 GrumpyMeow

@GrumpyMeow I think I've solved the issue with advertisments by async_rediscover_address in my fork. I've also solved the startup failure.

  1. Feel free to apply some patches from my fork…
  2. Could you add a license file, please?

v6ak avatar Dec 02 '24 13:12 v6ak