plantgateway
plantgateway copied to clipboard
Add device to Home Assistant auto-discovery
This PR adds a unique_id
to the discovery payload so that sensors are persisted in the Entity Registry. In addition, this adds Device information so that you can see all of the entities associated with each physical MiFlora device.
@ChristianKuehnel , I have assumed that the only devices recognised are Xiaomi (Line 304). Is that correct or does the gateway also detect other manufacturers ? Also, I see in the library that MiFloraPoller.name()
does not retrieve from cache but makes an additional bluetooth connection. Would it be worth caching name
in the same way that firmware_version
is cached ?
@PeteBa To respond to your question regarding other manufacturers: I'm pretty sure a lot of the other brands on Amazon at least (for example, OLLIVAN) use the exact same internals as the Xiaomi products. I was able to connect my OLLIVAN sensors without any difficulty.