This commit is contained in:
Paulus Schoutsen committed 2019-07-31 12:25:30 -07:00
1 parent da05dfe708
commit 4de97abc3a
2676 files changed
+163166 -140084

No files matched your search

@@ -75,7 +75,7 @@ class MockScanner(DeviceScanner):
Return None for dev1 for testing.
"""
return None if device == 'DEV1' else device.lower()
return None if device == "DEV1" else device.lower()
SCANNER = MockScanner()
@@ -3,11 +3,11 @@
from homeassistant.components.image_processing import ImageProcessingEntity
async def async_setup_platform(hass, config, async_add_entities_callback,
discovery_info=None):
async def async_setup_platform(
hass, config, async_add_entities_callback, discovery_info=None
):
"""Set up the test image_processing platform."""
async_add_entities_callback([
TestImageProcessing('camera.demo_camera', "Test")])
async_add_entities_callback([TestImageProcessing("camera.demo_camera", "Test")])
class TestImageProcessing(ImageProcessingEntity):
@@ -43,7 +43,7 @@ class TestImageProcessing(ImageProcessingEntity):
@property
def device_state_attributes(self):
"""Return device specific state attributes."""
return {'image': self._image}
return {"image": self._image}
def process_image(self, image):
"""Process image."""
@@ -14,14 +14,19 @@ def init(empty=False):
"""Initialize the platform with devices."""
global DEVICES
DEVICES = [] if empty else [
MockToggleDevice('Ceiling', STATE_ON),
MockToggleDevice('Ceiling', STATE_OFF),
MockToggleDevice(None, STATE_OFF)
]
DEVICES = (
[]
if empty
else [
MockToggleDevice("Ceiling", STATE_ON),
MockToggleDevice("Ceiling", STATE_OFF),
MockToggleDevice(None, STATE_OFF),
]
)
async def async_setup_platform(hass, config, async_add_entities_callback,
discovery_info=None):
async def async_setup_platform(
hass, config, async_add_entities_callback, discovery_info=None
):
"""Return mock devices."""
async_add_entities_callback(DEVICES)
@@ -14,14 +14,19 @@ def init(empty=False):
"""Initialize the platform with devices."""
global DEVICES
DEVICES = [] if empty else [
MockToggleDevice('AC', STATE_ON),
MockToggleDevice('AC', STATE_OFF),
MockToggleDevice(None, STATE_OFF)
]
DEVICES = (
[]
if empty
else [
MockToggleDevice("AC", STATE_ON),
MockToggleDevice("AC", STATE_OFF),
MockToggleDevice(None, STATE_OFF),
]
)
async def async_setup_platform(hass, config, async_add_entities_callback,
discovery_info=None):
async def async_setup_platform(
hass, config, async_add_entities_callback, discovery_info=None
):
"""Find and return test switches."""
async_add_entities_callback(DEVICES)