openhab-addons/bundles/org.openhab.binding.mqtt.homie/src
Cody Cutrer 22b28bf674
[mqtt.generic] separate command parsing from cached value updating (#12238)
* [mqtt.generic] separate command parsing from cached value updating

fixes #12150

Previously, Value.update would parse the command, _and_ update the cached
value with that command. Which means that when sending a command towards
MQTT (instead of processing an update from MQTT), the cached value was
unintentionally updated. This prevented the REFRESH command from returning
the most recent value received from the device.

Separating the two concerns also makes the test more obvious what they are
testing, and vastly simplified a kludgy workaround that RollershutterValue
was using to be able to process Commands that aren't States.

Signed-off-by: Cody Cutrer <cody@cutrer.us>

* [mqtt.generic] split Value::parseCommand into parseMessage

so that a particular value type subclass can have varying implementations
if it desires

---------

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-03-07 19:33:17 +01:00
..
main Update license headers to 2023 (#14154) 2023-01-06 09:49:54 +01:00
test/java/org/openhab/binding/mqtt/homie [mqtt.generic] separate command parsing from cached value updating (#12238) 2023-03-07 19:33:17 +01:00