@@ -65,11 +65,14 @@ def mock_setup_entry() -> Generator[AsyncMock]:
6565def _init_host_mock (host_mock : MagicMock ) -> None :
6666 host_mock .get_host_data = AsyncMock (return_value = None )
6767 host_mock .get_states = AsyncMock (return_value = None )
68+ host_mock .get_state = AsyncMock ()
6869 host_mock .check_new_firmware = AsyncMock (return_value = False )
70+ host_mock .subscribe = AsyncMock ()
6971 host_mock .unsubscribe = AsyncMock (return_value = True )
7072 host_mock .logout = AsyncMock (return_value = True )
7173 host_mock .reboot = AsyncMock ()
7274 host_mock .set_ptz_command = AsyncMock ()
75+ host_mock .get_motion_state_all_ch = AsyncMock (return_value = False )
7376 host_mock .is_nvr = True
7477 host_mock .is_hub = False
7578 host_mock .mac_address = TEST_MAC
@@ -138,8 +141,10 @@ def _init_host_mock(host_mock: MagicMock) -> None:
138141 # Disable tcp push by default for tests
139142 host_mock .baichuan .port = TEST_BC_PORT
140143 host_mock .baichuan .events_active = False
144+ host_mock .baichuan .subscribe_events = AsyncMock ()
141145 host_mock .baichuan .unsubscribe_events = AsyncMock ()
142146 host_mock .baichuan .check_subscribe_events = AsyncMock ()
147+ host_mock .baichuan .get_privacy_mode = AsyncMock ()
143148 host_mock .baichuan .mac_address .return_value = TEST_MAC_CAM
144149 host_mock .baichuan .privacy_mode .return_value = False
145150 host_mock .baichuan .day_night_state .return_value = "day"
@@ -242,3 +247,26 @@ def test_chime(reolink_connect: MagicMock) -> None:
242247 reolink_connect .chime_list = [TEST_CHIME ]
243248 reolink_connect .chime .return_value = TEST_CHIME
244249 return TEST_CHIME
250+
251+
252+ @pytest .fixture
253+ def reolink_chime (reolink_host : MagicMock ) -> None :
254+ """Mock a reolink chime."""
255+ TEST_CHIME = Chime (
256+ host = reolink_host ,
257+ dev_id = 12345678 ,
258+ channel = 0 ,
259+ )
260+ TEST_CHIME .name = "Test chime"
261+ TEST_CHIME .volume = 3
262+ TEST_CHIME .connect_state = 2
263+ TEST_CHIME .led_state = True
264+ TEST_CHIME .event_info = {
265+ "md" : {"switch" : 0 , "musicId" : 0 },
266+ "people" : {"switch" : 0 , "musicId" : 1 },
267+ "visitor" : {"switch" : 1 , "musicId" : 2 },
268+ }
269+
270+ reolink_host .chime_list = [TEST_CHIME ]
271+ reolink_host .chime .return_value = TEST_CHIME
272+ return TEST_CHIME
0 commit comments