Mqtt camera (#7092)
* first commit * minor fixes * minor fix * async_camera_image + test * minor fix * async calls
This commit is contained in:
1 parent
9249b6bc33
commit
7d76186798
2 files changed
+102
No files matched your search
@@ -0,0 +1,28 @@
|
||||
"""The tests for mqtt camera component."""
|
||||
import asyncio
|
||||
|
||||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.components.mqtt as mqtt
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_run_camera_setup(hass, test_client):
|
||||
"""Test that it fetches the given dispatcher data."""
|
||||
topic = 'test/camera'
|
||||
yield from async_setup_component(hass, 'camera', {
|
||||
'camera': {
|
||||
'platform': 'mqtt',
|
||||
'topic': topic,
|
||||
'name': 'Test Camera',
|
||||
}})
|
||||
|
||||
client = yield from test_client(hass.http.app)
|
||||
|
||||
mqtt.publish(hass, topic, 0xFFD8FF)
|
||||
yield from hass.async_block_till_done()
|
||||
|
||||
resp = yield from client.get('/api/camera_proxy/camera.test_camera')
|
||||
|
||||
assert resp.status == 200
|
||||
body = yield from resp.text()
|
||||
assert body == '16767231'
|
||||
Reference in new issue
Block a user