File tree Expand file tree Collapse file tree
tests/controllers/_device_state_monitor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Tests for the DeviceStateMonitor controller."""
22
3- from esphome_device_builder .controllers ._device_state_monitor .controller import DeviceStateMonitor
4- import pytest
53from unittest .mock import MagicMock
64
5+ import pytest
6+
7+ from esphome_device_builder .controllers ._device_state_monitor .controller import DeviceStateMonitor
8+
9+
710@pytest .fixture
811def monitor ():
912 """Fixture to provide a mock DeviceStateMonitor."""
@@ -14,9 +17,10 @@ def monitor():
1417 get_devices = MagicMock (return_value = []),
1518 on_state_change = MagicMock (),
1619 on_ip_change = MagicMock (),
17- on_queued_update_change = mock_on_queued # Pass the callback here
20+ on_queued_update_change = mock_on_queued , # Pass the callback here
1821 )
1922
23+
2024def test_apply_queued_update (monitor ):
2125 """Test that apply_queued_update triggers the callback correctly."""
2226 device_name = "test_device"
You can’t perform that action at this time.
0 commit comments