diff --git a/homeassistant/components/advantage_air/light.py b/homeassistant/components/advantage_air/light.py index f0ae669acde..19918992f7e 100644 --- a/homeassistant/components/advantage_air/light.py +++ b/homeassistant/components/advantage_air/light.py @@ -65,11 +65,13 @@ class AdvantageAirLight(AdvantageAirEntity, LightEntity): async def async_turn_on(self, **kwargs: Any) -> None: """Turn the light on.""" - await self.lights({"id": self._id, "state": ADVANTAGE_AIR_STATE_ON}) + await self.lights({self._id: {"id": self._id, "state": ADVANTAGE_AIR_STATE_ON}}) async def async_turn_off(self, **kwargs: Any) -> None: """Turn the light off.""" - await self.lights({"id": self._id, "state": ADVANTAGE_AIR_STATE_OFF}) + await self.lights( + {self._id: {"id": self._id, "state": ADVANTAGE_AIR_STATE_OFF}} + ) class AdvantageAirLightDimmable(AdvantageAirLight): @@ -84,7 +86,9 @@ class AdvantageAirLightDimmable(AdvantageAirLight): async def async_turn_on(self, **kwargs: Any) -> None: """Turn the light on and optionally set the brightness.""" - data: dict[str, Any] = {"id": self._id, "state": ADVANTAGE_AIR_STATE_ON} + data: dict[str, Any] = { + self._id: {"id": self._id, "state": ADVANTAGE_AIR_STATE_ON} + } if ATTR_BRIGHTNESS in kwargs: - data["value"] = round(kwargs[ATTR_BRIGHTNESS] * 100 / 255) + data[self._id]["value"] = round(kwargs[ATTR_BRIGHTNESS] * 100 / 255) await self.lights(data) diff --git a/homeassistant/components/advantage_air/manifest.json b/homeassistant/components/advantage_air/manifest.json index 85b093ea739..86bbbe3e57d 100644 --- a/homeassistant/components/advantage_air/manifest.json +++ b/homeassistant/components/advantage_air/manifest.json @@ -7,5 +7,5 @@ "iot_class": "local_polling", "loggers": ["advantage_air"], "quality_scale": "platinum", - "requirements": ["advantage_air==0.4.1"] + "requirements": ["advantage_air==0.4.2"] } diff --git a/requirements_all.txt b/requirements_all.txt index 4549ac8c223..20a3485da28 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -86,7 +86,7 @@ adext==0.4.2 adguardhome==0.6.1 # homeassistant.components.advantage_air -advantage_air==0.4.1 +advantage_air==0.4.2 # homeassistant.components.frontier_silicon afsapi==0.2.7 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index b00270895a5..4829fce3cc4 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -76,7 +76,7 @@ adext==0.4.2 adguardhome==0.6.1 # homeassistant.components.advantage_air -advantage_air==0.4.1 +advantage_air==0.4.2 # homeassistant.components.frontier_silicon afsapi==0.2.7 diff --git a/tests/components/advantage_air/__init__.py b/tests/components/advantage_air/__init__.py index e415485821f..9b7d9705366 100644 --- a/tests/components/advantage_air/__init__.py +++ b/tests/components/advantage_air/__init__.py @@ -18,7 +18,7 @@ TEST_SYSTEM_URL = ( ) TEST_SET_URL = f"http://{USER_INPUT[CONF_IP_ADDRESS]}:{USER_INPUT[CONF_PORT]}/setAircon" TEST_SET_LIGHT_URL = ( - f"http://{USER_INPUT[CONF_IP_ADDRESS]}:{USER_INPUT[CONF_PORT]}/setLight" + f"http://{USER_INPUT[CONF_IP_ADDRESS]}:{USER_INPUT[CONF_PORT]}/setLights" ) diff --git a/tests/components/advantage_air/test_light.py b/tests/components/advantage_air/test_light.py index 070008fc2f3..015d13867a4 100644 --- a/tests/components/advantage_air/test_light.py +++ b/tests/components/advantage_air/test_light.py @@ -64,8 +64,8 @@ async def test_light_async_setup_entry( ) assert len(aioclient_mock.mock_calls) == 3 assert aioclient_mock.mock_calls[-2][0] == "GET" - assert aioclient_mock.mock_calls[-2][1].path == "/setLight" - data = loads(aioclient_mock.mock_calls[-2][1].query["json"]) + assert aioclient_mock.mock_calls[-2][1].path == "/setLights" + data = loads(aioclient_mock.mock_calls[-2][1].query["json"]).get("100") assert data["id"] == "100" assert data["state"] == ADVANTAGE_AIR_STATE_ON assert aioclient_mock.mock_calls[-1][0] == "GET" @@ -79,8 +79,8 @@ async def test_light_async_setup_entry( ) assert len(aioclient_mock.mock_calls) == 5 assert aioclient_mock.mock_calls[-2][0] == "GET" - assert aioclient_mock.mock_calls[-2][1].path == "/setLight" - data = loads(aioclient_mock.mock_calls[-2][1].query["json"]) + assert aioclient_mock.mock_calls[-2][1].path == "/setLights" + data = loads(aioclient_mock.mock_calls[-2][1].query["json"]).get("100") assert data["id"] == "100" assert data["state"] == ADVANTAGE_AIR_STATE_OFF assert aioclient_mock.mock_calls[-1][0] == "GET" @@ -101,8 +101,8 @@ async def test_light_async_setup_entry( ) assert len(aioclient_mock.mock_calls) == 7 assert aioclient_mock.mock_calls[-2][0] == "GET" - assert aioclient_mock.mock_calls[-2][1].path == "/setLight" - data = loads(aioclient_mock.mock_calls[-2][1].query["json"]) + assert aioclient_mock.mock_calls[-2][1].path == "/setLights" + data = loads(aioclient_mock.mock_calls[-2][1].query["json"]).get("101") assert data["id"] == "101" assert data["value"] == 50 assert data["state"] == ADVANTAGE_AIR_STATE_ON