Fix Matter airconditioner discovery of climate platform (#114326)
* Discover Thermostat platform for Room Airconditioner device * add test * Adjust docstring Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
This commit is contained in:
parent
d6ac8ba5c8
commit
0e12fea0cb
4 changed files with 283 additions and 1 deletions
|
@ -25,6 +25,16 @@ async def thermostat_fixture(
|
|||
return await setup_integration_with_node_fixture(hass, "thermostat", matter_client)
|
||||
|
||||
|
||||
@pytest.fixture(name="room_airconditioner")
|
||||
async def room_airconditioner(
|
||||
hass: HomeAssistant, matter_client: MagicMock
|
||||
) -> MatterNode:
|
||||
"""Fixture for a room air conditioner node."""
|
||||
return await setup_integration_with_node_fixture(
|
||||
hass, "room-airconditioner", matter_client
|
||||
)
|
||||
|
||||
|
||||
# This tests needs to be adjusted to remove lingering tasks
|
||||
@pytest.mark.parametrize("expected_lingering_tasks", [True])
|
||||
async def test_thermostat(
|
||||
|
@ -387,3 +397,18 @@ async def test_thermostat(
|
|||
clusters.Thermostat.Enums.SetpointAdjustMode.kCool, -40
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
# This tests needs to be adjusted to remove lingering tasks
|
||||
@pytest.mark.parametrize("expected_lingering_tasks", [True])
|
||||
async def test_room_airconditioner(
|
||||
hass: HomeAssistant,
|
||||
matter_client: MagicMock,
|
||||
room_airconditioner: MatterNode,
|
||||
) -> None:
|
||||
"""Test if a climate entity is created for a Room Airconditioner device."""
|
||||
state = hass.states.get("climate.room_airconditioner")
|
||||
assert state
|
||||
assert state.attributes["current_temperature"] == 20
|
||||
assert state.attributes["min_temp"] == 16
|
||||
assert state.attributes["max_temp"] == 32
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue