Closed nhale25 closed 4 years ago
Hi,
Thanks for your contribution, much appreciated. I haven't had a chance to look at it yet, but will do as soon as the day job quietens down a bit.
Paul
On Thu, 14 May 2020 at 22:49, nhale25 notifications@github.com wrote:
When the user removes a Wiser device, it would still have an entry in BasePlugin.Units. This causes a KeyError in the Update* methods when the Unit is used to index into Devices.
This patch removes the (DevID, Unit) item from BasePlugin.Units when onDeviceRemoved() is called. This allows addDevices() to recreate the device before the next time updateDevices() is called.
You can view, comment on, or merge this pull request online at:
https://github.com/bloob00k/domoticz/pull/1 Commit Summary
- Correctly handle Wiser devices being removed.
File Changes
- M plugins/Wiser/plugin.py https://github.com/bloob00k/domoticz/pull/1/files#diff-33f079d697617ca54df5b9be2f277a80 (27)
Patch Links:
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bloob00k/domoticz/pull/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALT5CIVBLJCXA6ZQCW7FPLRRRROTANCNFSM4NBBZCEA .
Merged now, thanks.
When the user removes a Wiser device, it would still have an entry in BasePlugin.Units. This causes a KeyError in the Update* methods when the Unit is used to index into Devices.
This patch removes the (DevID, Unit) item from BasePlugin.Units when onDeviceRemoved() is called. This allows addDevices() to recreate the device before the next time updateDevices() is called.