-
Notifications
You must be signed in to change notification settings - Fork 21
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
Added support for chargers that are not reachable as installations #20
Added support for chargers that are not reachable as installations #20
Conversation
custom_components/zaptec/switch.py
Outdated
@@ -17,13 +17,13 @@ async def async_setup_platform( | |||
hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None | |||
) -> bool: # pylint: disable=unused-argument | |||
"""Setup switch platform.""" | |||
api = hass.data.get(DOMAIN, {}).get("api") | |||
if api is None: | |||
acc = hass.data[DOMAIN]["api"] |
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.
Use .get like I did before. This will raise and exception and not return 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.
fixed
Ok i’ll change that back. I changed it to this because In anorher file you did it this way
… 6 apr. 2022 kl. 01:23 skrev Steffen Fredriksen ***@***.***>:
@Hellowlol commented on this pull request.
In custom_components/zaptec/switch.py:
> @@ -17,13 +17,13 @@ async def async_setup_platform(
hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None
) -> bool: # pylint: disable=unused-argument
"""Setup switch platform."""
- api = hass.data.get(DOMAIN, {}).get("api")
- if api is None:
+ acc = hass.data[DOMAIN]["api"]
Use .get like I did before. This will raise and exception and not return None
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
This is a great PR! I'll do some testing to make sure we didn't break anything for Zaptec home. |
Thanks :)
… 6 apr. 2022 kl. 21:07 skrev Steffen Fredriksen ***@***.***>:
This is a great PR! I'll do some testing to make sure we didn't break anything for Zaptec home.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Any chance of getting this in a new release? I have tested the patch on our PRO-chargers and it works fine for me. |
I haven’t had time to test it yet. I’ll try to get it tested and released this weekend |
This adds support for PRO chargers that does not turn up as installations, and also removes some deprecation-warnings