Skip to content

Commit

Permalink
Prevent overwriting omnikinverter with authentication-less instance…
Browse files Browse the repository at this point in the history
… on "html" source type (#114)

This should have been an `elif`, now causing `source_type = "html"`
to fall into the `else` branch of the check for `"tcp"` and creating an
`OmnikInverter` instance without username and password.
  • Loading branch information
MarijnS95 authored Jun 4, 2022
1 parent aa9b77c commit c08ab6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/omnik_inverter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __init__(
username=self.config_entry.data[CONF_USERNAME],
password=self.config_entry.data[CONF_PASSWORD],
)
if self.config_entry.data[CONF_SOURCE_TYPE] == "tcp":
elif self.config_entry.data[CONF_SOURCE_TYPE] == "tcp":
self.omnikinverter = OmnikInverter(
host=self.config_entry.data[CONF_HOST],
source_type=self.config_entry.data[CONF_SOURCE_TYPE],
Expand Down

0 comments on commit c08ab6a

Please sign in to comment.