Skip to content

Commit

Permalink
Fix keep alive setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mletenay committed May 17, 2024
1 parent d26ff54 commit a8f1e83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/goodwe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass.data.setdefault(DOMAIN, {})
host = entry.options.get(CONF_HOST, entry.data[CONF_HOST])
protocol = entry.options.get(CONF_PROTOCOL, entry.data[CONF_PROTOCOL])
keep_alive = entry.options.get(CONF_KEEP_ALIVE, entry.data[CONF_PROTOCOL] != "TCP")
keep_alive = entry.options.get(CONF_KEEP_ALIVE, protocol != "TCP")
model_family = entry.options.get(CONF_MODEL_FAMILY, entry.data[CONF_MODEL_FAMILY])
network_retries = entry.options.get(CONF_NETWORK_RETRIES, DEFAULT_NETWORK_RETRIES)
network_timeout = entry.options.get(CONF_NETWORK_TIMEOUT, DEFAULT_NETWORK_TIMEOUT)
Expand Down
3 changes: 2 additions & 1 deletion custom_components/goodwe/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ async def async_step_init(self, user_input: dict | None = None) -> FlowResult:
CONF_HOST: self.config_entry.data[CONF_HOST],
CONF_PROTOCOL: self.config_entry.data[CONF_PROTOCOL],
CONF_KEEP_ALIVE: self.config_entry.options.get(
CONF_KEEP_ALIVE, self.config_entry.data[CONF_PROTOCOL] != "TCP"
CONF_KEEP_ALIVE,
self.config_entry.data.get(CONF_PROTOCOL) != "TCP",
),
CONF_MODEL_FAMILY: self.config_entry.data[CONF_MODEL_FAMILY],
CONF_SCAN_INTERVAL: self.config_entry.options.get(
Expand Down

0 comments on commit a8f1e83

Please sign in to comment.