]> git.basschouten.com Git - openhab-addons.git/commit
[nanoleaf] More robust caching of layout (#13998)
authorJørgen Austvik <jaustvik@acm.org>
Sun, 25 Dec 2022 19:56:04 +0000 (20:56 +0100)
committerGitHub <noreply@github.com>
Sun, 25 Dec 2022 19:56:04 +0000 (20:56 +0100)
commit6cd59e4c941f68a60d0ac38d24f45d23a514a292
treebdfce7b66d3429c7b951589714afead9f35c4fde
parent0357049f9f09185e89f56306f3b3072a68eda7f2
[nanoleaf] More robust caching of layout (#13998)

* [nanoleaf] More robust caching of layout

This is a bugfix/enhancement to make sure the caching of the layout
(to save it from being recalculated) works better:
- Only save previous layout if indeed painted
- Only save layout from the layout update, not the display state
- Recalculate anyway if current state is null

* Bugfix: Update colors

When Stefan runs, the getBridge() returns null, when Jørgen runs, is doesn't. But it isn't needed, because we
are already in the handler, so just call own methods.

Improvement: Less draws when updating colors

Instead of drawing the picture for each panel (which gave a cool effect), draw only once when we have parsed all color data.

Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafControllerHandler.java