From b464668cb0a8a19aad9a8c9363b0d9bde5eefef8 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Tue, 2 Apr 2024 12:06:53 +0000 Subject: [PATCH] Add version to upload details request --- hass_nabucasa/cloud_api.py | 2 ++ tests/test_cloud_api.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/hass_nabucasa/cloud_api.py b/hass_nabucasa/cloud_api.py index cd93ae598..b393ba9b6 100644 --- a/hass_nabucasa/cloud_api.py +++ b/hass_nabucasa/cloud_api.py @@ -163,6 +163,7 @@ async def async_files_upload_details( filename: str, base64md5hash: str, size: int, + homeassistant_version: str | None = None, ) -> dict[str, Any]: """Get files upload details.""" resp = await cloud.websession.get( @@ -171,6 +172,7 @@ async def async_files_upload_details( json={ "storage_type": storage_type, "filename": filename, + "homeassistant_version": homeassistant_version, "md5": base64md5hash, "size": size, }, diff --git a/tests/test_cloud_api.py b/tests/test_cloud_api.py index 88c837220..210b9440b 100644 --- a/tests/test_cloud_api.py +++ b/tests/test_cloud_api.py @@ -207,6 +207,7 @@ async def test_async_files_upload_detils( filename="test.txt", base64md5hash=base64md5hash, size=2, + homeassistant_version="1970.1.1", ) assert len(aioclient_mock.mock_calls) == 1 @@ -214,6 +215,7 @@ async def test_async_files_upload_detils( assert aioclient_mock.mock_calls[0][2] == { "filename": "test.txt", "storage_type": "test", + "homeassistant_version": "1970.1.1", "md5": base64md5hash, "size": 2, } @@ -255,6 +257,7 @@ async def test_async_files_upload_details_error( assert aioclient_mock.mock_calls[0][2] == { "filename": "test.txt", "storage_type": "test", + "homeassistant_version": None, "md5": base64md5hash, "size": 2, }