Don't allow charging button to be pushed unless the command is valid#215
Conversation
|
This issue is deeper than that. I've found some usage of "charger_mode" and "charge_mode", which I need to figure out. I'm also about to write a new issue for avoiding the usage "info" attributes, but rather use "state". |
|
If you are talking about entity names, |
Yes, with the latest fix in PR #216 the log now prints the Zaptec attribute name used in the entity, so that the mapping from Zaptec attribute to entity name is clearer.
We could "find" the old entity in the end of |
If we can delete it before the new entity is added, I believe it will get the same name (as long as the user has not manually edited the entity_id), but will require some digging and testing. Considering it's really the same entity, just reading from a different key, I would argue that this is one of the most ok cases for this. What are your thoughts on keeping the native zaptec values for the charger_mode-sensor? I know it's going to break my own sun charging automation (until I fix it), but I still think it would be good to stick with the native values for less confusion in developing the integration (it was part of why the increased polling rate wasn't working). |
|
There is another option: Today we use the If we go this route, we need a dedicated issue and PR, as this is a new "feature". |
|
Entities do get the same name/entity_id when the old entity is deleted before we add the new ones. I think there is already enough confusion with all the different ids and keys without adding yet another one, so I think I prefer the removal option. |
|
(We have to deal with that problem when we swap api.py to use ZaptecPascalCase unless we are to break every entity we have.) |
|
Are we dealing with that problem as part of 0.8? |
|
No, we are not. Pushing this ahead of us is ok. |
sveinse
left a comment
There was a problem hiding this comment.
LGTM
I haven't had time to test this. Give me a ping when you're completely done with the PR and I can have a go and eventually merge it.
|
The computation part of my automation works fine in a minimal test (once I changed I consider this ready for review/testing |
PS! I was hoping to get some time to replicate and document the HA dev setup I'm using before this "release sprint" ends. I can install anything into it PPS! I have until the end of this week to keep up this high activity level. I won't be able to keep the same tempo in the weeks to follow. |
Same here, so hopefully we can wrap up most of the topics this week 🤞 |
sveinse
left a comment
There was a problem hiding this comment.
LGTM.
If you're all set, I will proceed with the merge.
The Zaptec Custom component for HA v0.8 will migrate to use the zaptec native names for the charger state (see custom-components/zaptec#215 for details. This should not be merged until 0.8.0 is released
Addresses #209 by disabling the button if in an invalid state
Fixes #209, fixes #212, fixes #213