Bump pyatmo version (#52112)

* Bump pyatmo version

* Update tests
This commit is contained in:
Tobias Sauerwein 2021-06-23 15:51:27 +02:00 committed by GitHub
parent 75faee4f25
commit db5bf8ab23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 6 deletions

View File

@ -3,7 +3,7 @@
"name": "Netatmo", "name": "Netatmo",
"documentation": "https://www.home-assistant.io/integrations/netatmo", "documentation": "https://www.home-assistant.io/integrations/netatmo",
"requirements": [ "requirements": [
"pyatmo==5.0.1" "pyatmo==5.1.0"
], ],
"after_dependencies": [ "after_dependencies": [
"cloud", "cloud",

View File

@ -1306,7 +1306,7 @@ pyarlo==0.2.4
pyatag==0.3.5.3 pyatag==0.3.5.3
# homeassistant.components.netatmo # homeassistant.components.netatmo
pyatmo==5.0.1 pyatmo==5.1.0
# homeassistant.components.atome # homeassistant.components.atome
pyatome==0.1.1 pyatome==0.1.1

View File

@ -731,7 +731,7 @@ pyarlo==0.2.4
pyatag==0.3.5.3 pyatag==0.3.5.3
# homeassistant.components.netatmo # homeassistant.components.netatmo
pyatmo==5.0.1 pyatmo==5.1.0
# homeassistant.components.apple_tv # homeassistant.components.apple_tv
pyatv==0.7.7 pyatv==0.7.7

View File

@ -7,6 +7,7 @@ from homeassistant.components.webhook import async_handle_webhook
from homeassistant.util.aiohttp import MockRequest from homeassistant.util.aiohttp import MockRequest
from tests.common import load_fixture from tests.common import load_fixture
from tests.test_util.aiohttp import AiohttpClientMockResponse
CLIENT_ID = "1234" CLIENT_ID = "1234"
CLIENT_SECRET = "5678" CLIENT_SECRET = "5678"
@ -50,7 +51,7 @@ async def fake_post_request(*args, **kwargs):
if endpoint in "snapshot_720.jpg": if endpoint in "snapshot_720.jpg":
return b"test stream image bytes" return b"test stream image bytes"
if endpoint in [ elif endpoint in [
"setpersonsaway", "setpersonsaway",
"setpersonshome", "setpersonshome",
"setstate", "setstate",
@ -58,9 +59,16 @@ async def fake_post_request(*args, **kwargs):
"setthermmode", "setthermmode",
"switchhomeschedule", "switchhomeschedule",
]: ]:
return f'{{"{endpoint}": true}}' payload = f'{{"{endpoint}": true}}'
return json.loads(load_fixture(f"netatmo/{endpoint}.json")) else:
payload = json.loads(load_fixture(f"netatmo/{endpoint}.json"))
return AiohttpClientMockResponse(
method="POST",
url=kwargs["url"],
json=payload,
)
async def fake_post_request_no_data(*args, **kwargs): async def fake_post_request_no_data(*args, **kwargs):