]> git.basschouten.com Git - openhab-addons.git/commitdiff
Fixes #16990 - Gen1 nbo longer initializes when defined in .things (#17009)
authorMarkus Michels <markus7017@gmail.com>
Sun, 7 Jul 2024 07:48:51 +0000 (09:48 +0200)
committerGitHub <noreply@github.com>
Sun, 7 Jul 2024 07:48:51 +0000 (09:48 +0200)
Signed-off-by: Markus Michels <markus7017@gmail.com>
bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyBaseHandler.java

index 04d04cd445d2bbc7cf44484be4cb1de6872f4413..a8ab8cfe03ed02b80ca8ce6cdcc95911c870bccb 100755 (executable)
@@ -156,8 +156,8 @@ public abstract class ShellyBaseHandler extends BaseThingHandler
         Map<String, String> properties = thing.getProperties();
         String gen = getString(properties.get(PROPERTY_DEV_GEN));
         String thingType = getThingType();
-        gen2 = !"1".equals(gen) || ShellyDeviceProfile.isGeneration2(thingType);
         blu = ShellyDeviceProfile.isBluSeries(thingType);
+        gen2 = "2".equals(gen) || "3".equals(gen) || blu || ShellyDeviceProfile.isGeneration2(thingType);
         this.api = !blu ? !gen2 ? new Shelly1HttpApi(thingName, this) : new Shelly2ApiRpc(thingName, thingTable, this)
                 : new ShellyBluApi(thingName, thingTable, this);
         if (gen2) {