Closed sanjay900 closed 1 year ago
This is somewhat hacky, but what if we just wrote the entry_id into panel.serial_number
(if empty) in __init__
's setup()
-- before doing async_forward_entry_setups
?
It would get rid of a bunch of this extra plumbing -- which we'd otherwise need to do even more of, because the panel model we're removing from the device info should probably be replaced with entry_id as well, otherwise won't all the instances of the integration end up sharing the device?
Yeah okay lets do that, looking at it now after restarting home assistant my two devices got linked back up, so that is def required
I noted that it left behind an old device after all that, so ive added the necessary code to clean that device up as well.
Closes https://github.com/mag1024/bosch-alarm-homeassistant/issues/21
When generating unique ids for the entities, use the config entry id if the serial number is not available
Also, don't treat the panels model as a identifier, someone may have more than one panel with the same model!