Closed TheAzzi closed 3 years ago
Thank you for your detailed comments.
We are aware that there are a few issues related to deleting entities. Unfortunately the deletion procedures in HA are a bit flaky and there are only few successful examples in the codebase.
Yes, it is by design. There is no real obvious case for a device without any entities. The developers have discussed if we should block or warn the user that the removal the last sensor will also remove the device.
After posting the setting changes the integration is unloaded and reloaded again by design in HA. If all currently selected entities are removed, the device will also be removed. At reload of the new configuration everything is recreated including a new device with no area.
This is a bug and not by design.
We were aware of the problems in this area but decided to release the the new version anyway since it contains a lot of improved functionality.
Thank you for the feedback. I agree the new version is great, thank you all developers involved. None of these issues are deal breakers in any way, I just try to test/provide my input in case it can help improving the component.
Regarding 1. and 2.: I agree there is no real obvious case for a device without any entities, however it shouldn't hurt to keep it either. Perhaps a user is just cleaning up, figuring out which sensors to add, and so on. You still have the device, with it's area. I also assume if you didn't remove the device as mentioned in point 1, the strange behavior in point 2 wouldn't happen either. But it's not a big deal at all, it just makes more sense to me to keep the device.
A new release was just published that adresses these issues. Please test it and hopefully we can close this issue.
Sorry for late reply - I've been busy.
I was able to do some quick tests now, and so far it looks really good:
All in all an awesome release, thanks a lot! :-)
Testing version 0.9.19 and there are still issues related to adding/removing sensors:
Removing all sensors causes the device to disappear as well. Not sure if it is by design or not, but it should not be necessary, as it is possible to have a device without entities.
Similarly, if you remove all currently selected sensors but also add some new sensors in the same operation, this will also cause the device to be removed/regenerated, so you will see some strange behavior in the HA Integration UI (The line which says "1 device and X entities" disappears, and you have to refresh the page for it to appear again). The device also loose the area information when this happens.
If you remove a sensor, and wait 10-15 seconds, the "ghost" sensor will still reappear in the entities list (NOTE: It's will no longer be listed under the "Easee EV charger" integration, so you have to look at all entities to see it). So if you try to readd the sensor without restarting HA inbetween, you will still get the *_2 naming for the new sensor.