Extend the history of Elvia history to 3 years (#109490)
Extend the history of Elvia data to 3 years
This commit is contained in:
parent
a1cbc62ddc
commit
6f9876d5e0
2 changed files with 29 additions and 11 deletions
|
@ -35,8 +35,10 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
self._api_token = api_token = user_input[CONF_API_TOKEN]
|
||||
client = Elvia(meter_value_token=api_token).meter_value()
|
||||
try:
|
||||
end_time = dt_util.utcnow()
|
||||
results = await client.get_meter_values(
|
||||
start_time=(dt_util.now() - timedelta(hours=1)).isoformat()
|
||||
start_time=(end_time - timedelta(hours=1)).isoformat(),
|
||||
end_time=end_time.isoformat(),
|
||||
)
|
||||
|
||||
except ElviaError.AuthError as exception:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue