More entity service (#15998)
* Camera use entity service * Convert climate services * Convert light * Convert media player * Migrate fan
This commit is contained in:
1 parent
e4d41fe313
commit
1ff1639cef
7 files changed
+252
-442
No files matched your search
@@ -1,5 +1,5 @@
|
||||
"""The tests for local file camera component."""
|
||||
from unittest.mock import mock_open, patch, PropertyMock
|
||||
from unittest.mock import mock_open, patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -67,19 +67,6 @@ async def test_turn_off_invalid_camera(hass, demo_camera):
|
||||
assert demo_camera.state == STATE_STREAMING
|
||||
|
||||
|
||||
async def test_turn_off_unsupport_camera(hass, demo_camera):
|
||||
"""Turn off unsupported camera should quietly fail."""
|
||||
assert demo_camera.state == STATE_STREAMING
|
||||
with patch('homeassistant.components.camera.demo.DemoCamera'
|
||||
'.supported_features', new_callable=PropertyMock) as m:
|
||||
m.return_value = 0
|
||||
|
||||
await camera.async_turn_off(hass, demo_camera.entity_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert demo_camera.state == STATE_STREAMING
|
||||
|
||||
|
||||
async def test_motion_detection(hass):
|
||||
"""Test motion detection services."""
|
||||
# Setup platform
|
||||
|
||||
@@ -356,11 +356,10 @@ def test_signal_repetitions_cancelling(hass, monkeypatch):
|
||||
|
||||
yield from hass.async_block_till_done()
|
||||
|
||||
print(protocol.send_command_ack.call_args_list)
|
||||
assert protocol.send_command_ack.call_args_list[0][0][1] == 'off'
|
||||
assert protocol.send_command_ack.call_args_list[1][0][1] == 'on'
|
||||
assert protocol.send_command_ack.call_args_list[2][0][1] == 'on'
|
||||
assert protocol.send_command_ack.call_args_list[3][0][1] == 'on'
|
||||
assert protocol.send_command_ack.call_args_list[0][0][1] == 'on'
|
||||
assert protocol.send_command_ack.call_args_list[1][0][1] == 'off'
|
||||
assert protocol.send_command_ack.call_args_list[2][0][1] == 'off'
|
||||
assert protocol.send_command_ack.call_args_list[3][0][1] == 'off'
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
|
||||
Reference in new issue
Block a user