dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 498 forks source link

Optimize updatedLightNodeEndpoint() #7570

Closed manup closed 7 months ago

manup commented 7 months ago

This functions loops over all lights on each NodeEvent, which is wasteful on the CPU since only in case of a simple descriptor response the body is executed. Therefore only do this if the NodeEvent actually matches and bail out early otherwise.

The function can likely be removed all together, but needs some testing due the .rx() call.