openhab-core
openhab-core copied to clipboard
Normalize thing configuration before initialization
There were some reports on the forum that de-serialized values (and probably other) do not have the correct type. We already normalize thing configurations when they are set via REST API, but it seems that under some circumstances integer values are not properly de-serialized. This PR adds normalization of the configuration before the thing is initialized.
This is not the best solution, but unfortunately it'll get very complex otherwise. The best would be to normalize the configuration immediately when it is read from the database, but that can't be done because the config description needed for that is not available at the time the thing registry is first filled. Holding back things in the ManagedProvider would require keeping track of the config descriptions and thus duplicating what is already in the ThingManagerImpl.
Doing it before the initialization might also mitigate problems with integer/string values in textual configuration.
Signed-off-by: Jan N. Klug [email protected]
This pull request has been mentioned on openHAB Community. There might be relevant details there:
https://community.openhab.org/t/parsing-integer-config-entries-results-in-an-error-since-3-3-0-stable/136960/3
This pull request has been mentioned on openHAB Community. There might be relevant details there:
https://community.openhab.org/t/tapocontrol-control-tapo-smart-wifi-devices-with-openhab/118389/180