mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Bump Advantage Air to 0.4.2 (#91144)
This commit is contained in:
parent
a48ede7332
commit
82c80ec8d2
@ -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)
|
||||
|
@ -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"]
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
)
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user