From d243da99c73db23a0bf3d56a2220a37b1cc3ad47 Mon Sep 17 00:00:00 2001 From: muppet3000 Date: Wed, 30 Nov 2022 09:56:47 +0000 Subject: [PATCH] Bump growattServer to 1.3.0 (#82953) * Growatt library bump and init tweak (#81951) * Addressing review comments (#81951) --- homeassistant/components/growatt_server/manifest.json | 2 +- homeassistant/components/growatt_server/sensor.py | 7 ++++++- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/growatt_server/manifest.json b/homeassistant/components/growatt_server/manifest.json index e3b63f7c8b3..3bb2317e0ef 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.2.4"], + "requirements": ["growattServer==1.3.0"], "codeowners": ["@indykoning", "@muppet3000", "@JasperPlant"], "iot_class": "cloud_polling", "loggers": ["growattServer"] diff --git a/homeassistant/components/growatt_server/sensor.py b/homeassistant/components/growatt_server/sensor.py index d6b74b78475..d9ca800131f 100644 --- a/homeassistant/components/growatt_server/sensor.py +++ b/homeassistant/components/growatt_server/sensor.py @@ -80,7 +80,12 @@ async def async_setup_entry( config[CONF_URL] = url hass.config_entries.async_update_entry(config_entry, data=config) - api = growattServer.GrowattApi() + # Initialise the library with a random user id each time it is started, + # also extend the library's default identifier to include 'home-assistant' + api = growattServer.GrowattApi( + add_random_user_id=True, + agent_identifier=f"{growattServer.GrowattApi.agent_identifier} - home-assistant", + ) api.server_url = url devices, plant_id = await hass.async_add_executor_job(get_device_list, api, config) diff --git a/requirements_all.txt b/requirements_all.txt index 4e3aa5cc52f..5908a0eb94d 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -817,7 +817,7 @@ greenwavereality==0.5.1 gridnet==4.0.0 # homeassistant.components.growatt_server -growattServer==1.2.4 +growattServer==1.3.0 # homeassistant.components.google_sheets gspread==5.5.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index acfc7af20ac..44582937de4 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -612,7 +612,7 @@ greeneye_monitor==3.0.3 gridnet==4.0.0 # homeassistant.components.growatt_server -growattServer==1.2.4 +growattServer==1.3.0 # homeassistant.components.google_sheets gspread==5.5.0