This seems to work very well, please review and accept if you're OK with my changes.
The ID can never be guaranteed unique, but with my changes, it's as unique as it gets I guess. Works well on my system with a few sensors with identical names and labels, adding the unit type to the ID made it unique.
I'm writing to the log every time a sensor is "lost", or the user will never know, and this is certainly useful info.
I'm also using the ID and not the name, both for logging and in the exception, as this is unique and makes it easier to pinpoint exactly which sensor was missing.
This seems to work very well, please review and accept if you're OK with my changes.
The ID can never be guaranteed unique, but with my changes, it's as unique as it gets I guess. Works well on my system with a few sensors with identical names and labels, adding the unit type to the ID made it unique.
I'm writing to the log every time a sensor is "lost", or the user will never know, and this is certainly useful info.
I'm also using the ID and not the name, both for logging and in the exception, as this is unique and makes it easier to pinpoint exactly which sensor was missing.