[Hue Play HDMI Sync Box Binding] Inbox and using custom id for thing - Bug ๐Ÿ›, or expected behaviour?

Hi all,

during testing the Hue Play HDMI Sync Box Binding Iโ€™ve noticed, that my current implementation changes the UID of the thing if the discovered device is added with a custom id. As a result, the already added device is added again - as the UID of the discovered thing does not match the device added with a custom id.

Is this behaviour expected, or do I need to modify the handling of the ThingUID creation to avoid this effect. I was a bit surprised, that the ID and UID influence each other.

Advice is appreciated - ideal would be a โ€œbest practiceโ€ implementation example I could use as inspiration.

As the openHAB 4.3 preview builds are available now, I would like to merge soon to include the binding in the preview builds to have better test coverage. Therefore I would like to avoid a complex UID/ID handling if it is not necessary - or an easy solution is already available.

with kind regards,
Patrik