Skip to content
This repository was archived by the owner on May 7, 2020. It is now read-only.

Number scaling issues when JsonStorage deserializes DiscoveryResult properties #5899

Open
wborn opened this issue Jul 12, 2018 · 0 comments
Open

Comments

@wborn
Copy link
Contributor

wborn commented Jul 12, 2018

Similar to #3774 scaling issues occur with the properties map of DiscoveryResult objects when the JsonStorage is used.

This issue for instance occurs with the productId, productVersion and vendorId properties discovered in LifxLightDiscovery:

https://github.com/eclipse/smarthome/blob/d28ea636733021512b9fff608432ac48f1f65570/extensions/binding/org.eclipse.smarthome.binding.lifx/src/main/java/org/eclipse/smarthome/binding/lifx/internal/LifxLightDiscovery.java#L343-L355

As soon as these Things are approved the long value properties get a .0 suffix.

It can also be reproduced by adding a serial number property to the MagicDiscoveryService. After approving a Magic Thing from the Inbox with serial number 1L or 4242424242L the following Thing properties show in Paper UI:

2

This issue could be resolved by also registering a type adapter for DiscoveryResult objects on the JsonStorage as was done for Configuration objects in #3783:

https://github.com/eclipse/smarthome/blob/4336b8e339f9e834413a9517bc3fb5be6f44cd79/bundles/storage/org.eclipse.smarthome.storage.json/src/main/java/org/eclipse/smarthome/storage/json/internal/JsonStorage.java#L90

Though there are some issues with this:

  • org.eclipse.smarthome.config.discovery.internal.DiscoveryResultImpl is part of an internal package
  • this solution does not scale well to other object types

See also the discussion in: #5878

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant