]> git.basschouten.com Git - openhab-addons.git/commit
[unifi] Detect all PoE ports, and set PoE thing offline if no data could be found...
authorHilbrand Bouwkamp <hilbrand@h72.nl>
Mon, 3 Oct 2022 11:02:46 +0000 (13:02 +0200)
committerGitHub <noreply@github.com>
Mon, 3 Oct 2022 11:02:46 +0000 (13:02 +0200)
commit0560a0e333c3d7a1c26c2c4c9dfb658d35b03d11
tree80563d46b006849c0fd5d800b9c2b1d067726799
parent64d97374ad613ddf7922577043f66b4547ea7f6e
[unifi] Detect all PoE ports, and set PoE thing offline if no data could be found (#13455)

* [unifi] Set PoE thing offline if no data could be found

This would better reflect the PoE thing status if there is a problem with either the data from the api or a configuration problem (like invalid port number).

* [unifi] Fix bug to detect PoE ports when first port is not PoE port

The binding assumed either all ports or no ports were PoE, and asssumed if port 0 was not PoE none was PoE.
However, some switches have ports starting at port 5 to be PoE. Therefor changed code to just test each port if it is PoE.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiControllerCache.java
bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiPoePortThingHandler.java
bundles/org.openhab.binding.unifi/src/main/resources/OH-INF/i18n/unifi.properties