From 6e80d2777016b7fccdcb3b8c834b64582d4e9f15 Mon Sep 17 00:00:00 2001 From: muppet3000 Date: Wed, 15 Sep 2021 09:08:15 +0100 Subject: [PATCH] Bump growattServer to 1.1.0 (#56084) --- homeassistant/components/growatt_server/config_flow.py | 2 +- homeassistant/components/growatt_server/manifest.json | 2 +- homeassistant/components/growatt_server/sensor.py | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/growatt_server/test_config_flow.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/growatt_server/config_flow.py b/homeassistant/components/growatt_server/config_flow.py index d6b2c7db9fe..c4a97a81f0a 100644 --- a/homeassistant/components/growatt_server/config_flow.py +++ b/homeassistant/components/growatt_server/config_flow.py @@ -47,7 +47,7 @@ class GrowattServerConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): if not login_response["success"] and login_response["errCode"] == "102": return self._async_show_user_form({"base": "invalid_auth"}) - self.user_id = login_response["userId"] + self.user_id = login_response["user"]["id"] self.data = user_input return await self.async_step_plant() diff --git a/homeassistant/components/growatt_server/manifest.json b/homeassistant/components/growatt_server/manifest.json index ab2d07c147b..79472359ab9 100644 --- a/homeassistant/components/growatt_server/manifest.json +++ b/homeassistant/components/growatt_server/manifest.json @@ -3,7 +3,7 @@ "name": "Growatt", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/growatt_server/", - "requirements": ["growattServer==1.0.1"], + "requirements": ["growattServer==1.1.0"], "codeowners": ["@indykoning", "@muppet3000", "@JasperPlant"], "iot_class": "cloud_polling" } diff --git a/homeassistant/components/growatt_server/sensor.py b/homeassistant/components/growatt_server/sensor.py index 03da4fe4b57..f2eea640e99 100644 --- a/homeassistant/components/growatt_server/sensor.py +++ b/homeassistant/components/growatt_server/sensor.py @@ -861,7 +861,7 @@ def get_device_list(api, config): if not login_response["success"] and login_response["errCode"] == "102": _LOGGER.error("Username, Password or URL may be incorrect!") return - user_id = login_response["userId"] + user_id = login_response["user"]["id"] if plant_id == DEFAULT_PLANT_ID: plant_info = api.plant_list(user_id) plant_id = plant_info["data"][0]["plantId"] diff --git a/requirements_all.txt b/requirements_all.txt index 3220de21329..d39130cefa9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -739,7 +739,7 @@ greeneye_monitor==2.1 greenwavereality==0.5.1 # homeassistant.components.growatt_server -growattServer==1.0.1 +growattServer==1.1.0 # homeassistant.components.gstreamer gstreamer-player==1.1.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index ba9d9bf0128..79db4959f63 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -423,7 +423,7 @@ googlemaps==2.5.1 greeclimate==0.11.8 # homeassistant.components.growatt_server -growattServer==1.0.1 +growattServer==1.1.0 # homeassistant.components.profiler guppy3==3.1.0 diff --git a/tests/components/growatt_server/test_config_flow.py b/tests/components/growatt_server/test_config_flow.py index 096052fd6cf..db46ed36911 100644 --- a/tests/components/growatt_server/test_config_flow.py +++ b/tests/components/growatt_server/test_config_flow.py @@ -40,7 +40,7 @@ GROWATT_PLANT_LIST_RESPONSE = { }, "success": True, } -GROWATT_LOGIN_RESPONSE = {"userId": 123456, "userLevel": 1, "success": True} +GROWATT_LOGIN_RESPONSE = {"user": {"id": 123456}, "userLevel": 1, "success": True} async def test_show_authenticate_form(hass):