Skip to content
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

Merged

Conversation

mrfrostfire
Copy link
Contributor

This adds support for PRO chargers that does not turn up as installations, and also removes some deprecation-warnings

@@ -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"]
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@mrfrostfire
Copy link
Contributor Author

mrfrostfire commented Apr 6, 2022 via email

@Hellowlol
Copy link
Collaborator

This is a great PR! I'll do some testing to make sure we didn't break anything for Zaptec home.

@mrfrostfire
Copy link
Contributor Author

mrfrostfire commented Apr 6, 2022 via email

@Olen
Copy link
Contributor

Olen commented Apr 26, 2022

Any chance of getting this in a new release?
Anyone verified it with HOME chargers?

I have tested the patch on our PRO-chargers and it works fine for me.

@Hellowlol
Copy link
Collaborator

I haven’t had time to test it yet. I’ll try to get it tested and released this weekend

@Hellowlol Hellowlol closed this Apr 26, 2022
@Hellowlol Hellowlol reopened this Apr 26, 2022
@Hellowlol Hellowlol merged commit 005d5ac into custom-components:master May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants