indiefan / king_smith

Home Assistant Integration for King Smith treadmills (e.g. WalkingPad)
MIT License
17 stars 8 forks source link

Rediscover device after unloading config entry #41

Closed pedropombeiro closed 3 months ago

pedropombeiro commented 3 months ago

This MR follows the suggestion in https://developers.home-assistant.io/docs/core/bluetooth/api/#triggering-rediscovery-of-devices to force a rescan of the device after unloading the config entry. I noticed that if HA lost connection to the device (let's say I turned off the Walking Pad for a few hours and then came back to use it), it would no longer be able to correctly work, even if I tried reloading the config entry for the King Smith integration. The only way to get it back working was to restart Home Assistant.

indiefan commented 3 months ago

Hm. seems like maybe these lint errors are actually pre-existing. I'm going to land your pull requests cause they're super valuable and figure out the lint stuff separately.