bloob00k / domoticz

0 stars 0 forks source link

Correctly handle Wiser devices being removed. #1

Closed nhale25 closed 4 years ago

nhale25 commented 4 years ago

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.

bloob00k commented 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

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 .

bloob00k commented 4 years ago

Merged now, thanks.