Use local time instead of UTC time as default backup filenames (#100959)

Use local time instead of UTC for the backup name
This commit is contained in:
Jan-Philipp Benecke 2023-09-27 13:32:30 +02:00 committed by GitHub
parent 01b5854968
commit 96151e7faa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 3 deletions

View file

@ -548,7 +548,7 @@ async def test_service_calls(
assert aioclient_mock.call_count == 30
assert aioclient_mock.mock_calls[-1][2] == {
"name": "2021-11-13 11:48:00",
"name": "2021-11-13 03:48:00",
"homeassistant": True,
"addons": ["test"],
"folders": ["ssl"],
@ -605,6 +605,24 @@ async def test_service_calls(
await hass.async_block_till_done()
assert aioclient_mock.call_count == 34
assert aioclient_mock.mock_calls[-1][2] == {
"name": "2021-11-13 03:48:00",
"location": None,
}
# check backup with different timezone
await hass.config.async_update(time_zone="Europe/London")
await hass.services.async_call(
"hassio",
"backup_full",
{
"location": "/backup",
},
)
await hass.async_block_till_done()
assert aioclient_mock.call_count == 36
assert aioclient_mock.mock_calls[-1][2] == {
"name": "2021-11-13 11:48:00",
"location": None,