]> git.basschouten.com Git - openhab-addons.git/commit
[homematic] Validate datapoint values before writing to config (#12557)
authormaniac103 <dannybaumann@web.de>
Sun, 3 Apr 2022 09:39:59 +0000 (11:39 +0200)
committerGitHub <noreply@github.com>
Sun, 3 Apr 2022 09:39:59 +0000 (11:39 +0200)
commit28ce7ebaedf3729cfa246b8a4896b6eedb0eb529
tree10252ee26ac8627213f409f3b765f4f4dabcb3dc
parent79245b5d8944e70721da21a5614a6efd01137d27
[homematic] Validate datapoint values before writing to config (#12557)

* [homematic] Validate datapoint values before writing to config

HM config datapoint values on some devices can be out of their valid
range in some cases, particularly if they are unused by the device
currently [1]. Since openhab-core now validates attempts to update
configuration by the thing handlers, make sure we always send a valid
configuration even for those affected datapoints.

[1] One example for such behaviour is HmIPW-DRBL4, which has multiple
    datapoints which depend on each other
    - POWERUP_JUMPTARGET can have values OFF, ON, OFF_DELAY, ON_DELAY
    - POWERUP_ONDELAY_VALUE, POWERUP_ONDELAY_UNIT are only used if
      POWERUP_JUMPTARGET has value ON_DELAY
    - likewise, POWERUP_OFFDELAY_VALUE and POWERUP_OFFDELAY_UNIT are
      only used if POWERUP_JUMPTARGET has value OFF_DELAY
    - if e.g. the POWERUP_JUMPTARGET is OFF, e.g. POWERUP_ONDELAY_VALUE
      might stay uninitialized by CCU and/or device itself, in which
      case it may be reported with an invalid value

Signed-off-by: Danny Baumann <dannybaumann@web.de>
bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicThingHandler.java
bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapoint.java