]> git.basschouten.com Git - openhab-addons.git/commitdiff
[http] Fix parsing of Color RGB values (#10897)
authorRyz <mirco.heitmann@gmail.com>
Tue, 22 Jun 2021 10:51:16 +0000 (12:51 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Jun 2021 10:51:16 +0000 (12:51 +0200)
* Fixed parsing of Color RGB values

Signed-off-by: Ryz <mirco.heitmann@gmail.com>
bundles/org.openhab.binding.http/src/main/java/org/openhab/binding/http/internal/converter/ColorItemConverter.java

index 5da525a7832d5362a8209a319f4f26e643576282..0c5193132aae6d521614f5a8af4ddc24f609ecd4 100644 (file)
@@ -109,9 +109,9 @@ public class ColorItemConverter extends AbstractTransformingItemConverter {
             if (matcher.matches()) {
                 switch (channelConfig.colorMode) {
                     case RGB:
-                        int r = Integer.parseInt(matcher.group(0));
-                        int g = Integer.parseInt(matcher.group(1));
-                        int b = Integer.parseInt(matcher.group(2));
+                        int r = Integer.parseInt(matcher.group(1));
+                        int g = Integer.parseInt(matcher.group(2));
+                        int b = Integer.parseInt(matcher.group(3));
                         newState = HSBType.fromRGB(r, g, b);
                         break;
                     case HSB: