Update demo camera images

This commit is contained in:
Paulus Schoutsen 2015-11-28 23:16:20 -08:00
parent 286299c4c9
commit 70698f7ab0
11 changed files with 4 additions and 3 deletions

View file

@ -19,7 +19,6 @@ from homeassistant.const import (
)
from homeassistant.helpers.entity_component import EntityComponent
import homeassistant.util.dt as dt_util
DOMAIN = 'camera'

View file

@ -4,8 +4,8 @@ homeassistant.components.camera.demo
Demo platform that has a fake camera.
"""
import os
from random import randint
from homeassistant.components.camera import Camera
import homeassistant.util.dt as dt_util
def setup_platform(hass, config, add_devices, discovery_info=None):
@ -24,8 +24,10 @@ class DemoCamera(Camera):
def camera_image(self):
""" Return a faked still image response. """
now = dt_util.utcnow()
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:
return file.read()

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB