Black
This commit is contained in:
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)
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Component with embedded platforms."""
|
||||
DOMAIN = 'test_embedded'
|
||||
DOMAIN = "test_embedded"
|
||||
|
||||
|
||||
async def async_setup(hass, config):
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
"""Switch platform for the embedded component."""
|
||||
|
||||
|
||||
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."""
|
||||
pass
|
||||
@@ -2,7 +2,7 @@
|
||||
from .const import TEST # noqa
|
||||
|
||||
|
||||
DOMAIN = 'test_package'
|
||||
DOMAIN = "test_package"
|
||||
|
||||
|
||||
async def async_setup(hass, config):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Provide a mock standalone component."""
|
||||
DOMAIN = 'test_standalone'
|
||||
DOMAIN = "test_standalone"
|
||||
|
||||
|
||||
async def async_setup(hass, config):
|
||||
|
||||
Reference in new issue
Block a user