From 21b91f75ba2037b7f9f41de13fd7f1f7f6cd284c Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Fri, 23 Sep 2022 13:46:25 -0600 Subject: [PATCH] Bump `regenmaschine` to 2022.09.2 (#79010) * Bump `regenmaschine` to 2022.09.2 * Fix tests * Restore incorrectly-deleted test --- homeassistant/components/rainmachine/__init__.py | 2 +- homeassistant/components/rainmachine/config_flow.py | 2 +- homeassistant/components/rainmachine/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/rainmachine/conftest.py | 6 ++---- .../rainmachine/fixtures/api_versions_data.json | 2 +- tests/components/rainmachine/test_diagnostics.py | 12 ++++++++++-- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/rainmachine/__init__.py b/homeassistant/components/rainmachine/__init__.py index ff52b74ab16..8cc3b3d5e80 100644 --- a/homeassistant/components/rainmachine/__init__.py +++ b/homeassistant/components/rainmachine/__init__.py @@ -497,7 +497,7 @@ class RainMachineEntity(CoordinatorEntity): f"{self._entry.data[CONF_PORT]}" ), connections={(dr.CONNECTION_NETWORK_MAC, self._data.controller.mac)}, - name=str(self._data.controller.name).capitalize(), + name=self._data.controller.name.capitalize(), manufacturer="RainMachine", model=( f"Version {self._version_coordinator.data['hwVer']} " diff --git a/homeassistant/components/rainmachine/config_flow.py b/homeassistant/components/rainmachine/config_flow.py index c12362591e7..eed80b9c145 100644 --- a/homeassistant/components/rainmachine/config_flow.py +++ b/homeassistant/components/rainmachine/config_flow.py @@ -132,7 +132,7 @@ class RainMachineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): # access token without using the IP address and password, so we have to # store it: return self.async_create_entry( - title=str(controller.name), + title=controller.name.capitalize(), data={ CONF_IP_ADDRESS: user_input[CONF_IP_ADDRESS], CONF_PASSWORD: user_input[CONF_PASSWORD], diff --git a/homeassistant/components/rainmachine/manifest.json b/homeassistant/components/rainmachine/manifest.json index 6a87110f6f6..ca7543bfb38 100644 --- a/homeassistant/components/rainmachine/manifest.json +++ b/homeassistant/components/rainmachine/manifest.json @@ -3,7 +3,7 @@ "name": "RainMachine", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/rainmachine", - "requirements": ["regenmaschine==2022.09.1"], + "requirements": ["regenmaschine==2022.09.2"], "codeowners": ["@bachya"], "iot_class": "local_polling", "homekit": { diff --git a/requirements_all.txt b/requirements_all.txt index fe15419d7db..8f5bfd7ec5b 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2138,7 +2138,7 @@ raincloudy==0.0.7 raspyrfm-client==1.2.8 # homeassistant.components.rainmachine -regenmaschine==2022.09.1 +regenmaschine==2022.09.2 # homeassistant.components.renault renault-api==0.1.11 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index a38c27925e4..f877e9a5890 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1468,7 +1468,7 @@ radios==0.1.1 radiotherm==2.1.0 # homeassistant.components.rainmachine -regenmaschine==2022.09.1 +regenmaschine==2022.09.2 # homeassistant.components.renault renault-api==0.1.11 diff --git a/tests/components/rainmachine/conftest.py b/tests/components/rainmachine/conftest.py index 1dfef7e399c..af00a1013e0 100644 --- a/tests/components/rainmachine/conftest.py +++ b/tests/components/rainmachine/conftest.py @@ -51,10 +51,8 @@ def controller_fixture( """Define a regenmaschine controller.""" controller = AsyncMock() controller.api_version = "4.5.0" - controller.hardware_version = 3 - # The api returns a controller with all numbers as numeric - # instead of a string - controller.name = 12345 + controller.hardware_version = "3" + controller.name = "12345" controller.mac = controller_mac controller.software_version = "4.0.925" diff --git a/tests/components/rainmachine/fixtures/api_versions_data.json b/tests/components/rainmachine/fixtures/api_versions_data.json index d4ec1fb80e9..67cfa4ce033 100644 --- a/tests/components/rainmachine/fixtures/api_versions_data.json +++ b/tests/components/rainmachine/fixtures/api_versions_data.json @@ -1,5 +1,5 @@ { "apiVer": "4.6.1", - "hwVer": 3, + "hwVer": "3", "swVer": "4.0.1144" } diff --git a/tests/components/rainmachine/test_diagnostics.py b/tests/components/rainmachine/test_diagnostics.py index a600c5f7c34..7cf8406d2ae 100644 --- a/tests/components/rainmachine/test_diagnostics.py +++ b/tests/components/rainmachine/test_diagnostics.py @@ -21,7 +21,11 @@ async def test_entry_diagnostics(hass, config_entry, hass_client, setup_rainmach }, "data": { "coordinator": { - "api.versions": {"apiVer": "4.6.1", "hwVer": 3, "swVer": "4.0.1144"}, + "api.versions": { + "apiVer": "4.6.1", + "hwVer": "3", + "swVer": "4.0.1144", + }, "machine.firmware_update_status": { "lastUpdateCheckTimestamp": 1657825288, "packageDetails": [], @@ -635,7 +639,11 @@ async def test_entry_diagnostics_failed_controller_diagnostics( }, "data": { "coordinator": { - "api.versions": {"apiVer": "4.6.1", "hwVer": 3, "swVer": "4.0.1144"}, + "api.versions": { + "apiVer": "4.6.1", + "hwVer": "3", + "swVer": "4.0.1144", + }, "machine.firmware_update_status": { "lastUpdateCheckTimestamp": 1657825288, "packageDetails": [],