Skip to content

Commit

Permalink
- make WebApi PollInterval configurable (min 60 Seconds/30 Seconds SE…
Browse files Browse the repository at this point in the history
…NEC.Home V4)

- this is a release version 3.0.6
  • Loading branch information
marq24 committed Sep 16, 2023
1 parent e20eca4 commit d4bb6b5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
11 changes: 10 additions & 1 deletion custom_components/senec/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ async def async_step_system(self, user_input=None):
async def async_step_websetup(self, user_input=None):
"""Handle a flow initialized by the user."""
if user_input is not None:
# we need to check the scan_interval (configured by the user)... we hard code a limit of 1 minute for all
# SENEC.Home V2 & V3 Systems - only V4 can set it to 30 seconds
if "ome V4" in self.data.get(CONF_DEV_TYPE):
user_input[CONF_SCAN_INTERVAL] = max(user_input.get(CONF_SCAN_INTERVAL), 30)
else:
user_input[CONF_SCAN_INTERVAL] = max(user_input.get(CONF_SCAN_INTERVAL), 60)
self.options.update(user_input)
return self._update_options()

Expand All @@ -482,7 +488,10 @@ async def async_step_websetup(self, user_input=None):
): str,
vol.Required(
CONF_PASSWORD, default=self.options.get(CONF_PASSWORD, self.data.get(CONF_PASSWORD, ""))
): str
): str,
vol.Required(
CONF_SCAN_INTERVAL, default=self.options.get(CONF_SCAN_INTERVAL, self.data.get(CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL)),
): int # pylint: disable=line-too-long
}
)
return self.async_show_form(
Expand Down
6 changes: 3 additions & 3 deletions custom_components/senec/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"name": "Anzeige Name",
"username": "Dein 'mein-senec.de' Benutzername (E-Mail)",
"password": "Dein 'mein-senec.de' Passwort",
"scan_interval":"Aktualisierungsintervall in Sekunden"
"scan_interval":"Aktualisierungsintervall in Sekunden [> 60 Sekunden (30 Sekunden für SENEC.Home V4)]"
}
},
"optional_websetup_required_info": {
Expand All @@ -66,12 +66,12 @@
}
},
"websetup": {
"description": "MEIN-SENEC.DE Webzugang",
"description": "MEIN-SENEC.DE Webzugang\n\n\nWenn Du Hilfe benötigst, findest du sie hier: https://github.com/marq24/ha-senec-v3",
"data": {
"name": "Anzeige Name",
"username": "Dein 'mein-senec.de' Benutzername (E-Mail)",
"password": "Dein 'mein-senec.de' Passwort",
"scan_interval":"Aktualisierungsintervall in Sekunden"
"scan_interval":"Aktualisierungsintervall in Sekunden [Minimum 60 Sekunden (30 Sekunden für SENEC.Home V4)]"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions custom_components/senec/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"name": "Display name",
"username": "Your 'mein-senec.de' username",
"password": "Your 'mein-senec.de' password",
"scan_interval":"Polling Interval in seconds"
"scan_interval":"Polling Interval in seconds [> 60 seconds (30 seconds for SENEC.Home V4)]"
}
},
"optional_websetup_required_info": {
Expand All @@ -66,12 +66,12 @@
}
},
"websetup": {
"description": "MEIN-SENEC.DE WebAccess",
"description": "MEIN-SENEC.DE WebAccess\n\n\nIf you need help with the configuration have a look here: https://github.com/marq24/ha-senec-v3",
"data": {
"name": "Display name",
"username": "Your 'mein-senec.de' username",
"password": "Your 'mein-senec.de' password",
"scan_interval":"Polling Interval in seconds"
"scan_interval":"Polling Interval in seconds [minimum 60 seconds (30 seconds for SENEC.Home V4)]"
}
}
}
Expand Down

0 comments on commit d4bb6b5

Please sign in to comment.