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",
"documentation": "https://www.home-assistant.io/integrations/netatmo",
"requirements": [
"pyatmo==5.0.1"
"pyatmo==5.1.0"
],
"after_dependencies": [
"cloud",

View file

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

View file

@ -731,7 +731,7 @@ pyarlo==0.2.4
pyatag==0.3.5.3
# homeassistant.components.netatmo
pyatmo==5.0.1
pyatmo==5.1.0
# homeassistant.components.apple_tv
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 tests.common import load_fixture
from tests.test_util.aiohttp import AiohttpClientMockResponse
CLIENT_ID = "1234"
CLIENT_SECRET = "5678"
@ -50,7 +51,7 @@ async def fake_post_request(*args, **kwargs):
if endpoint in "snapshot_720.jpg":
return b"test stream image bytes"
if endpoint in [
elif endpoint in [
"setpersonsaway",
"setpersonshome",
"setstate",
@ -58,9 +59,16 @@ async def fake_post_request(*args, **kwargs):
"setthermmode",
"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):