]> git.basschouten.com Git - openhab-addons.git/commit
[nanoleaf] More color for less network calls (#13893)
authorJørgen Austvik <jaustvik@acm.org>
Sun, 11 Dec 2022 15:09:53 +0000 (16:09 +0100)
committerGitHub <noreply@github.com>
Sun, 11 Dec 2022 15:09:53 +0000 (16:09 +0100)
commit70cca8fc778cecc3091dc99a1cf8a8c0188981bd
tree82bf661794e53bbe4beadd4c32d254afbc18689e
parent1dbcaf8f0c7e66d33544c0ca1774b312bb7e0070
[nanoleaf] More color for less network calls (#13893)

* [nanoleaf] More color for less network calls

This is a refactoring that moves the "get panel color" out of the
panel handler and into a separate class, with callbacks.

This makes us do only one REST call to get colors instead of one per
panel that is a thing. It also lets us retrieve colors for all panels -
 also those that doesn't have a thing in OpenHAB,

While testing this out, I found a bug where solid colors set in the app
wasn't reflected in neither the controller nor panel channels, and that
should also be fixed now.

Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafBindingConstants.java
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/colors/NanoleafControllerColorChangeListener.java [new file with mode: 0644]
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/colors/NanoleafPanelColorChangeListener.java [new file with mode: 0644]
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/colors/NanoleafPanelColors.java [new file with mode: 0644]
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafControllerHandler.java
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafPanelHandler.java
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/layout/ConstantPanelState.java [new file with mode: 0644]
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/layout/LivePanelState.java [new file with mode: 0644]
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/layout/PanelState.java
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/layout/shape/PanelFactory.java
bundles/org.openhab.binding.nanoleaf/src/test/java/org/openhab/binding/nanoleaf/internal/layout/NanoleafLayoutTest.java