]> git.basschouten.com Git - openhab-addons.git/commit
[homematic] Fix updating enum config values (#14213)
authormaniac103 <dannybaumann@web.de>
Fri, 13 Jan 2023 15:25:26 +0000 (16:25 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Jan 2023 15:25:26 +0000 (16:25 +0100)
commit4dd60bb4428a09bbb69f94943682f3a2340c928d
tree3edb3c1fbed1d5a670624535c3f68cd145bb71db
parent4e44de38947df4553087764e7659e8f9da6c0a4c
[homematic] Fix updating enum config values (#14213)

When changing an enum value in the configuration, we used the wrong data
type: while the value in the OH config is a string (the 'option value' -
see HomematicThingHandler::getValueForConfiguration), internally we use
an integer (the 'option index'), so we have to do the option value ->
option index conversion when applying the new value.
This especially was a problem for HM-MOD-EM-8 devices, which check the
CHANNEL_FUNCTION enum value as part of their initialization routine.
When disabling/enabling them after changing the CHANNEL_FUNCTION enum
value, they went offline, because their initialization failed due to a
NumberFormatException (via
HomematicThingHandler::doInitializeInBackground ->
HmChannel::checkForChannelFunctionChange ->
HmChannel::getCurrentFunction)

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