* [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>
To mitigate issue https://github.com/openhab/openhab-core/issues/3125
(common thread pool exhaustion when combining parallel streams with
synchronization or locks)
Signed-off-by: Sami Salonen <ssalonen@gmail.com>
So that other pieces of openhab can know what unit it's going to be,
without it having a value yet. Importantly, any necessary conversion
that need to be applied to the other portion of the state description -
min, max, and step.
See also https://github.com/openhab/openhab-core/pull/3132
Signed-off-by: Cody Cutrer <cody@cutrer.us>
HASS registers availability topics before calling start(), so
the AbstractMQTTThingHandler was never subscribing/starting the
availability channel(s). So do so in start() of the base class.
I checked other implementations, and either they already handle
re-registering availabilityTopics in their start()
(GenericMQTTThingHandler), or they don't use availabilityTopics
at all from the base class and manage it themselves (Homie).
Note that this shows up as newly-added HASS things not having
a problem (because the components aren't discovered until after
the ThingHandler is started), but if you restart OpenHAB or
disable/enable the thing, the channels (and components) are
cached, thus how availabilityTopics are known before starting.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Range is 0..255, not 0..250.
rgb -> hsv -> rgb still isn't perfect, but it's better. In
particular, I found this when using HSBType.BLUE in a test,
and it was coming out as 0,0,250 in RGB. It now comes out as
a proper 0,0,255.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* New translations bluetooth.properties (Finnish)
* New translations danfossairunit.properties (Danish)
* New translations hdpowerview.properties (Danish)
* New translations jruby.properties (Italian)
* New translations miele.properties (Danish)
* New translations mqtt.properties (Italian)
* New translations openwebnet.properties (Italian)
fixes#10711
technically this code is in mqtt.generic, but it's only used by Homie.
in particular, if an incoming string doesn't match an enum, this will now
just ignore the value instead of raising an exception to be caught somewhere inside
of Hive MQTT, and eventually timing out and logging that mandatory topics weren't
received, instead of logging a pointer to the actual problem. this makes it so that
if there's a homie $datatype openhab doesn't understand (like duration), it will be
able to get to the point of just choosing a string channel
also did some minor debug logging cleanup for mqtt:
* fixed a typo
* when logging homie device name from the thing handler, use the config deviceid,
since we likely don't have the attributes from MQTT yet
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* Add UOM for MQTT Channels
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Fix dependencies
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Simplify units parsing, remove channelUID from NumberValue constructor
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Simplify pattern
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Fix tests
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Correct Units reference
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Correct homeassistant binding changes
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Wrap precision in temperature unit definition
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Use BigDecimal for precision
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Use BigDecimal throughout
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Fix SAT
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Inverty equals check
Signed-off-by: James Melville <jamesmelville@gmail.com>
* [MQTT] Add additional logging information
Add additional logging information when command is not supported by type.
Signed-off-by: Lukas Agethen <lukas83@gmx.de>
* Switch properties files encoding from ISO-8859-1 to UTF-8
Crowdin will generate translations in this encoding, so this prevents a lot of diffs which makes it easier to review future Crowdin PRs.
Related to openhab/openhab-core#2298
Signed-off-by: Wouter Born <github@maindrain.net>
* Reworks many commons-lang usages to use standard Java
* Updates all remaining commons.lang imports to commons.lang3
Related to openhab/openhab-addons#7722
Signed-off-by: Wouter Born <github@maindrain.net>
* Updates links to target the openhab-addons 'main' branch instead of the 'master' branch
* Updates some NOTICE files to indicate content is maintained by openHAB instead of Eclipse SmartHome
Signed-off-by: Wouter Born <github@maindrain.net>
Add-ons should not depend on tec.uom.se classes but use core unit classes instead so they are less impacted when this library is replaced or upgraded.
Signed-off-by: Wouter Born <github@maindrain.net>