-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use strict data model checks with pydantic #48
Conversation
Why are you adding the names back in tot he entity description? Having hardcoded names is no longer allowed on new integrations. The names (if manually added) need to be added via the strings file using the translated_key. |
Got it, will fix |
@disforw I've generated data models for pyonwater:https://github.com/kdeyev/pyonwater/blob/v0.2.1/pyonwater/models/eow_models.py |
Ready for review |
HA will not accept a new integration with description names hardcoded. I'll post documentation. The translation_key will lookup the name (if required) in the strings file. Some entities do not need a name because HA will auto determine the name from the class used. |
Also, I used the "key" with proper case to match the actual flag because core doesn't care about case in the key |
I'd remove all the names, revert all the keys and change line 110 back to use description.key |
Hey @disforw . Sorry for the misunderstanding.
The name is only used for the unique_id generation here:
The latest version of pyonwater uses snake_case for attributes and all the changes you see here are made to support it. |
I could use the key here:
But then unique_id will be changed, If it's not a concern I can easily do that |
Ah, I see what you did now... Do you think it adds a layer of unnecessary complexity? |
pyonwater version is updated