Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor
Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor copied to clipboard
Add unique_id
I am guessing based on the other PR that you want the merge into dev and not master.
Besides all the formatting changes (I do this in Home Assistant dev environment so it runs black etc. for me) it implements unique id so one can format the entity after it's in HA.
Let me know if you don't want the formatting but I notice also the imports etc. are not to HA preference so I would not mind to do a follow-up PR to "clean" it a bit to standard.
Yup, I prefer to keep code changes on dev branch until a release.
Shouldn't unique_id be generated automatically instead of being provided in yaml?
Imports would probably benefit form a little bit of isort but I have mixed feelings about black, as it tends to split lines in places I prefer to keep inline
Shouldn't
unique_idbe generated automatically instead of being provided in yaml?
Not for yaml as they need to be persistent between reboots (or it would create a new entity every time) hence why someone needs to manually type something unique.
Imports would probably benefit form a little bit of
isortbut I have mixed feelings aboutblack, as it tends to split lines in places I prefer to keep inline
I know what you mean 😄
Before I reformat all your stuff here let me know how you want it, worst case I just use notepad or something to add the bits in 😆
Not for yaml as they need to be persistent between reboots (or it would create a new entity every time) hence why someone needs to manually type something unique.
Well, it doesn't have to be randomly generated. My idea would be to use some existing parameter (maybe host?) to generate it.
Before I reformat all your stuff here let me know how you want it, worst case I just use notepad or something to add the bits in 😆
Maybe let's leave it as it is for now, your changes are small enough to be possible to be done in notepad 😜
Ok, so moved back on the formatting thanks to notepad 😆
I still say it's better to have a manual unique id as host and all other parameters could change. Maybe not a big deal for this integration but on the other hand with all this config adding one more should not be a deal-breaker
The problem is that most of users won't configure it when it has to provided manually. Host for a vacuum usually doesn't change even when it is not set as static because vacuum is connected to WiFi all the time. Additionally vacuum has to be reconfigured as well, so I would stick to generating unique_id using host.
That's not a problem as then it would just be as today. It would be for more "advanced" users who knows what it is and how to use it. But it's your show so if you insist then I can change it 😃
I plan to add config flow to this integration someday, using host will match it better as well
Ok, I set it now so it's some text + the host to ensure it's unique in everyone's HA.
just wondered if there was any further progress on this?
HI, i've just installed the xiaomi cloud map extractor. The unique id is still missing
I want to configure it (rename it, change the icon and so on) but i can't. Should I define it manually ?
Moreover, in the last release home assistant provide an image entity. Maybe defining a camera isn't needed anymore.
@akanegally you can change entity id by setting name in the config. You can also change icon in yaml (documentation).
Maybe defining a camera isn't needed anymore.
I think you have misunderstood how image entities work