Bump Python Matter Server library to 6.1.0(b0) (#118388)

This commit is contained in:
Marcel van der Veldt 2024-05-29 19:20:18 +02:00 committed by GitHub
parent 23381ff30c
commit 7136be5047
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 18 additions and 97 deletions

View file

@ -1,7 +1,6 @@
"""Test Matter sensors."""
from datetime import UTC, datetime, timedelta
from unittest.mock import MagicMock, patch
from unittest.mock import MagicMock
from matter_server.client.models.node import MatterNode
import pytest
@ -16,8 +15,6 @@ from .common import (
trigger_subscription_callback,
)
from tests.common import async_fire_time_changed
@pytest.fixture(name="flow_sensor_node")
async def flow_sensor_node_fixture(
@ -280,26 +277,6 @@ async def test_eve_energy_sensors(
assert state.attributes["device_class"] == "current"
assert state.attributes["friendly_name"] == "Eve Energy Plug Current"
# test if the sensor gets polled on interval
eve_energy_plug_node.update_attribute("1/319486977/319422472", 237.0)
async_fire_time_changed(hass, datetime.now(UTC) + timedelta(seconds=31))
await hass.async_block_till_done()
entity_id = "sensor.eve_energy_plug_voltage"
state = hass.states.get(entity_id)
assert state
assert state.state == "237.0"
# test extra poll triggered when secondary value (switch state) changes
set_node_attribute(eve_energy_plug_node, 1, 6, 0, True)
eve_energy_plug_node.update_attribute("1/319486977/319422474", 5.0)
with patch("homeassistant.components.matter.entity.EXTRA_POLL_DELAY", 0.0):
await trigger_subscription_callback(hass, matter_client)
await hass.async_block_till_done()
entity_id = "sensor.eve_energy_plug_power"
state = hass.states.get(entity_id)
assert state
assert state.state == "5.0"
# This tests needs to be adjusted to remove lingering tasks
@pytest.mark.parametrize("expected_lingering_tasks", [True])