Update demo camera images
@ -19,7 +19,6 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from homeassistant.helpers.entity_component import EntityComponent
|
from homeassistant.helpers.entity_component import EntityComponent
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
|
|
||||||
|
|
||||||
DOMAIN = 'camera'
|
DOMAIN = 'camera'
|
||||||
|
@ -4,8 +4,8 @@ homeassistant.components.camera.demo
|
|||||||
Demo platform that has a fake camera.
|
Demo platform that has a fake camera.
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
from random import randint
|
|
||||||
from homeassistant.components.camera import Camera
|
from homeassistant.components.camera import Camera
|
||||||
|
import homeassistant.util.dt as dt_util
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
@ -24,8 +24,10 @@ class DemoCamera(Camera):
|
|||||||
|
|
||||||
def camera_image(self):
|
def camera_image(self):
|
||||||
""" Return a faked still image response. """
|
""" Return a faked still image response. """
|
||||||
|
now = dt_util.utcnow()
|
||||||
|
|
||||||
image_path = os.path.join(os.path.dirname(__file__),
|
image_path = os.path.join(os.path.dirname(__file__),
|
||||||
'demo_{}.png'.format(randint(1, 5)))
|
'demo_{}.jpg'.format(now.second % 4))
|
||||||
with open(image_path, 'rb') as file:
|
with open(image_path, 'rb') as file:
|
||||||
return file.read()
|
return file.read()
|
||||||
|
|
||||||
|
BIN
homeassistant/components/camera/demo_0.jpg
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
homeassistant/components/camera/demo_1.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 9.5 KiB |
BIN
homeassistant/components/camera/demo_2.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 9.4 KiB |
BIN
homeassistant/components/camera/demo_3.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 9.5 KiB |