Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/esphome/assist_satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def on_pipeline_event(self, event: PipelineEvent) -> None:
}
elif event_type == VoiceAssistantEventType.VOICE_ASSISTANT_RUN_START:
assert event.data is not None
if tts_output := event.data["tts_output"]:
if tts_output := event.data.get("tts_output"):
path = tts_output["url"]
url = async_process_play_media_url(self.hass, path)
data_to_send = {"url": url}
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/esphome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"mqtt": ["esphome/discover/#"],
"quality_scale": "platinum",
"requirements": [
"aioesphomeapi==32.2.1",
"aioesphomeapi==32.2.4",
"esphome-dashboard-api==1.3.0",
"bleak-esphome==2.16.0"
],
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirements_test_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions tests/components/reolink/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ def mock_setup_entry() -> Generator[AsyncMock]:
def _init_host_mock(host_mock: MagicMock) -> None:
host_mock.get_host_data = AsyncMock(return_value=None)
host_mock.get_states = AsyncMock(return_value=None)
host_mock.get_state = AsyncMock()
host_mock.check_new_firmware = AsyncMock(return_value=False)
host_mock.subscribe = AsyncMock()
host_mock.unsubscribe = AsyncMock(return_value=True)
host_mock.logout = AsyncMock(return_value=True)
host_mock.reboot = AsyncMock()
host_mock.set_ptz_command = AsyncMock()
host_mock.get_motion_state_all_ch = AsyncMock(return_value=False)
host_mock.is_nvr = True
host_mock.is_hub = False
host_mock.mac_address = TEST_MAC
Expand Down Expand Up @@ -138,8 +141,10 @@ def _init_host_mock(host_mock: MagicMock) -> None:
# Disable tcp push by default for tests
host_mock.baichuan.port = TEST_BC_PORT
host_mock.baichuan.events_active = False
host_mock.baichuan.subscribe_events = AsyncMock()
host_mock.baichuan.unsubscribe_events = AsyncMock()
host_mock.baichuan.check_subscribe_events = AsyncMock()
host_mock.baichuan.get_privacy_mode = AsyncMock()
host_mock.baichuan.mac_address.return_value = TEST_MAC_CAM
host_mock.baichuan.privacy_mode.return_value = False
host_mock.baichuan.day_night_state.return_value = "day"
Expand Down Expand Up @@ -242,3 +247,26 @@ def test_chime(reolink_connect: MagicMock) -> None:
reolink_connect.chime_list = [TEST_CHIME]
reolink_connect.chime.return_value = TEST_CHIME
return TEST_CHIME


@pytest.fixture
def reolink_chime(reolink_host: MagicMock) -> None:
"""Mock a reolink chime."""
TEST_CHIME = Chime(
host=reolink_host,
dev_id=12345678,
channel=0,
)
TEST_CHIME.name = "Test chime"
TEST_CHIME.volume = 3
TEST_CHIME.connect_state = 2
TEST_CHIME.led_state = True
TEST_CHIME.event_info = {
"md": {"switch": 0, "musicId": 0},
"people": {"switch": 0, "musicId": 1},
"visitor": {"switch": 1, "musicId": 2},
}

reolink_host.chime_list = [TEST_CHIME]
reolink_host.chime.return_value = TEST_CHIME
return TEST_CHIME
1 change: 1 addition & 0 deletions tests/components/reolink/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ async def test_webhook_callback(
assert hass.states.get(entity_id).state == STATE_OFF

# test webhook callback success all channels
reolink_connect.get_motion_state_all_ch.return_value = True
reolink_connect.motion_detected.return_value = True
reolink_connect.ONVIF_event_callback.return_value = None
await client.post(f"/api/webhook/{webhook_id}")
Expand Down
Loading
Loading