Closed rogrun closed 2 years ago
Image: Not currently, because the addon-service is not providing an image to openHAB, but I'll raise a PR for that.
Regarding the UoM change: I didn't have time to check the code yet (hope to find time tomorrow). Are channels that were created with an older version of the binding automatically changed to the new channel-types?
Image: Sounds good. 😀
UoM: The existing channels are not automatically changed to the new channel-types. Currently the thing has to be deleted and rediscovered.
Is there a way to do this automatically?
Do not hurry, it would be nice if it is in the new release.
If I remember correctly, channels are added dynamically when an update is received and the channel is missing, is that correct? If so, it's quite easy to do. How many channels are affected?
Yes, that's right, channels are added dynamically. About 30 channels are affected.
Ok, it's a bit work, but you need to add a dependency
<dependencies>
<dependency>
<groupId>org.smarthomej.addons.bundles</groupId>
<artifactId>org.smarthomej.commons</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
then inherit the thing handler from UpdatingBaseThingHandler
instead of BaseThingHandler
.
Then create a file update/device.update
with the content
1;REMOVE_CHANNEL;channel1
1;REMOVE_CHANNEL;channel2
1;REMOVE_CHANNEL;channel3
...
and finally add a property <thingTypeVersion>1</thingTypeVersion>
to the device
-thing (in the OH-INF/things/thing-types.xml
.
All changes are done. But the thingTypeVersion
property is not automatically added to the device thing
Only deletion and rediscovery works. Is it correct that way?
No. It should be added and it works for me. Are you sure it is not added? Do you see the Updating {} from version {} to {}
message again on next startup?
I have made a mistake. I created the update folder in the wrong place. Now it works for me. Thanks :)
Everything is done. Ready for review.
Thanks :) I have done the requested changes.
Good to know with Json.fromJson
:)
This PR includes a refactoring for UOM and adding channels for consumption.
I have also added the Viessmann logo (Viessmann allowed me to do this / I asked for it) Is it possible to add this logo in the bindings area on OH like on the official bindings?