-
-
Notifications
You must be signed in to change notification settings - Fork 61
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 button entity for pulse switches #245
Conversation
I tried your branch, but it failed (see below). Let me known when I can try again. 2021-12-17 22:55:12 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry central for button |
class OcppButtonDescription(ButtonEntityDescription): | ||
"""Class to describe a Button entity.""" | ||
|
||
press_action: str | None = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this | None syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neither did I, I copied it over from the Wallbox integration but looks like it does not work with a string. Should be fixed now 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the issue was I forgot to import typing Any. See Union here for explanation
i can see the buttons, and reset works for me. Unlock does not: my charger responds with 'Unsupported'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
Should we also add a button for a RemoteStopTransaction? |
This will only work with 2021.12 and above so perhaps give it a while before tagging into a release. I have updated the slider but that's not yet compatible with 2021.12.3, hopefully it'll be in .4 |
The 'Charge_Control' switch when switched off while charging already performs a RemoteStopTransaction. So in my view it's not required. |
Not sure on best way to handle chargers that don't support 'Unlock' as code-wise it is not known until the command is sent. What's your view? Eg on return of 'Unsupported' the button availability could be set to false? Or made part of the initial config flow? |
@lbbrhzn, I can't test on a live system at the moment. If you're able to on your charger before merging that'd be great.