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 .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
uses: dawidd6/action-download-artifact@v11
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: home-assistant/intents-package
repo: OHF-Voice/intents-package
branch: main
workflow: nightly.yaml
workflow_conclusion: success
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/ovo_energy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"loggers": ["ovoenergy"],
"requirements": ["ovoenergy==2.0.0"]
"requirements": ["ovoenergy==2.0.1"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/unifiprotect/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"integration_type": "hub",
"iot_class": "local_push",
"loggers": ["uiprotect", "unifi_discovery"],
"requirements": ["uiprotect==7.13.0", "unifi-discovery==1.2.0"],
"requirements": ["uiprotect==7.14.0", "unifi-discovery==1.2.0"],
"ssdp": [
{
"manufacturer": "Ubiquiti Networks",
Expand Down
4 changes: 2 additions & 2 deletions requirements_all.txt

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

4 changes: 2 additions & 2 deletions requirements_test_all.txt

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

5 changes: 0 additions & 5 deletions script/hassfest/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,6 @@
# opower > arrow > types-python-dateutil
"arrow": {"types-python-dateutil"}
},
"ovo_energy": {
# https://github.com/timmo001/ovoenergy/issues/132
# ovoenergy > incremental > setuptools
"incremental": {"setuptools"}
},
"pi_hole": {"hole": {"async-timeout"}},
"pvpc_hourly_pricing": {"aiopvpc": {"async-timeout"}},
"remote_rpi_gpio": {
Expand Down
5 changes: 4 additions & 1 deletion tests/components/reolink/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def _init_host_mock(host_mock: MagicMock) -> None:
host_mock.reboot = AsyncMock()
host_mock.set_ptz_command = AsyncMock()
host_mock.get_motion_state_all_ch = AsyncMock(return_value=False)
host_mock.get_stream_source = AsyncMock()
host_mock.get_snapshot = AsyncMock()
host_mock.get_encoding = AsyncMock(return_value="h264")
host_mock.ONVIF_event_callback = AsyncMock()
host_mock.is_nvr = True
host_mock.is_hub = False
host_mock.mac_address = TEST_MAC
Expand Down Expand Up @@ -105,7 +109,6 @@ def _init_host_mock(host_mock: MagicMock) -> None:
host_mock.camera_uid.return_value = TEST_UID_CAM
host_mock.camera_online.return_value = True
host_mock.channel_for_uid.return_value = 0
host_mock.get_encoding.return_value = "h264"
host_mock.firmware_update_available.return_value = False
host_mock.session_active = True
host_mock.timeout = 60
Expand Down
34 changes: 17 additions & 17 deletions tests/components/reolink/test_binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ async def test_motion_sensor(
hass_client_no_auth: ClientSessionGenerator,
freezer: FrozenDateTimeFactory,
config_entry: MockConfigEntry,
reolink_connect: MagicMock,
reolink_host: MagicMock,
) -> None:
"""Test binary sensor entity with motion sensor."""
reolink_connect.model = TEST_DUO_MODEL
reolink_connect.motion_detected.return_value = True
reolink_host.model = TEST_DUO_MODEL
reolink_host.motion_detected.return_value = True
with patch("homeassistant.components.reolink.PLATFORMS", [Platform.BINARY_SENSOR]):
assert await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
Expand All @@ -34,16 +34,16 @@ async def test_motion_sensor(
entity_id = f"{Platform.BINARY_SENSOR}.{TEST_NVR_NAME}_motion_lens_0"
assert hass.states.get(entity_id).state == STATE_ON

reolink_connect.motion_detected.return_value = False
reolink_host.motion_detected.return_value = False
freezer.tick(DEVICE_UPDATE_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()

assert hass.states.get(entity_id).state == STATE_OFF

# test ONVIF webhook callback
reolink_connect.motion_detected.return_value = True
reolink_connect.ONVIF_event_callback.return_value = [0]
reolink_host.motion_detected.return_value = True
reolink_host.ONVIF_event_callback.return_value = [0]
webhook_id = config_entry.runtime_data.host.webhook_id
client = await hass_client_no_auth()
await client.post(f"/api/webhook/{webhook_id}", data="test_data")
Expand All @@ -56,11 +56,11 @@ async def test_smart_ai_sensor(
hass_client_no_auth: ClientSessionGenerator,
freezer: FrozenDateTimeFactory,
config_entry: MockConfigEntry,
reolink_connect: MagicMock,
reolink_host: MagicMock,
) -> None:
"""Test smart ai binary sensor entity."""
reolink_connect.model = TEST_HOST_MODEL
reolink_connect.baichuan.smart_ai_state.return_value = True
reolink_host.model = TEST_HOST_MODEL
reolink_host.baichuan.smart_ai_state.return_value = True
with patch("homeassistant.components.reolink.PLATFORMS", [Platform.BINARY_SENSOR]):
assert await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
Expand All @@ -69,7 +69,7 @@ async def test_smart_ai_sensor(
entity_id = f"{Platform.BINARY_SENSOR}.{TEST_NVR_NAME}_crossline_zone1_person"
assert hass.states.get(entity_id).state == STATE_ON

reolink_connect.baichuan.smart_ai_state.return_value = False
reolink_host.baichuan.smart_ai_state.return_value = False
freezer.tick(DEVICE_UPDATE_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
Expand All @@ -80,7 +80,7 @@ async def test_smart_ai_sensor(
async def test_tcp_callback(
hass: HomeAssistant,
config_entry: MockConfigEntry,
reolink_connect: MagicMock,
reolink_host: MagicMock,
) -> None:
"""Test tcp callback using motion sensor."""

Expand All @@ -95,11 +95,11 @@ def register_callback(

callback_mock = callback_mock_class()

reolink_connect.model = TEST_HOST_MODEL
reolink_connect.baichuan.events_active = True
reolink_connect.baichuan.subscribe_events.reset_mock(side_effect=True)
reolink_connect.baichuan.register_callback = callback_mock.register_callback
reolink_connect.motion_detected.return_value = True
reolink_host.model = TEST_HOST_MODEL
reolink_host.baichuan.events_active = True
reolink_host.baichuan.subscribe_events.reset_mock(side_effect=True)
reolink_host.baichuan.register_callback = callback_mock.register_callback
reolink_host.motion_detected.return_value = True

with patch("homeassistant.components.reolink.PLATFORMS", [Platform.BINARY_SENSOR]):
assert await hass.config_entries.async_setup(config_entry.entry_id)
Expand All @@ -110,7 +110,7 @@ def register_callback(
assert hass.states.get(entity_id).state == STATE_ON

# simulate a TCP push callback
reolink_connect.motion_detected.return_value = False
reolink_host.motion_detected.return_value = False
assert callback_mock.callback_func is not None
callback_mock.callback_func()

Expand Down
14 changes: 6 additions & 8 deletions tests/components/reolink/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def test_camera(
hass: HomeAssistant,
hass_client_no_auth: ClientSessionGenerator,
config_entry: MockConfigEntry,
reolink_connect: MagicMock,
reolink_host: MagicMock,
) -> None:
"""Test camera entity with fluent."""
with patch("homeassistant.components.reolink.PLATFORMS", [Platform.CAMERA]):
Expand All @@ -37,28 +37,26 @@ async def test_camera(
assert hass.states.get(entity_id).state == CameraState.IDLE

# check getting a image from the camera
reolink_connect.get_snapshot.return_value = b"image"
reolink_host.get_snapshot.return_value = b"image"
assert (await async_get_image(hass, entity_id)).content == b"image"

reolink_connect.get_snapshot.side_effect = ReolinkError("Test error")
reolink_host.get_snapshot.side_effect = ReolinkError("Test error")
with pytest.raises(HomeAssistantError):
await async_get_image(hass, entity_id)

# check getting the stream source
assert await async_get_stream_source(hass, entity_id) is not None

reolink_connect.get_snapshot.reset_mock(side_effect=True)


@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_camera_no_stream_source(
hass: HomeAssistant,
config_entry: MockConfigEntry,
reolink_connect: MagicMock,
reolink_host: MagicMock,
) -> None:
"""Test camera entity with no stream source."""
reolink_connect.model = TEST_DUO_MODEL
reolink_connect.get_stream_source.return_value = None
reolink_host.model = TEST_DUO_MODEL
reolink_host.get_stream_source.return_value = None

with patch("homeassistant.components.reolink.PLATFORMS", [Platform.CAMERA]):
assert await hass.config_entries.async_setup(config_entry.entry_id)
Expand Down
4 changes: 2 additions & 2 deletions tests/components/reolink/test_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
async def test_entry_diagnostics(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
reolink_connect: MagicMock,
test_chime: Chime,
reolink_host: MagicMock,
reolink_chime: Chime,
config_entry: MockConfigEntry,
snapshot: SnapshotAssertion,
) -> None:
Expand Down
Loading