mirror of
https://github.com/home-assistant/core.git
synced 2025-06-05 05:37:04 +00:00
Run asyncio event loop in debug mode during tests (#13058)
* Run asyncio event loop in debug mode during tests * Remove debug mode again
This commit is contained in:
parent
a7f34bbce9
commit
7018806802
@ -49,8 +49,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
})
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Set up an Arlo IP Camera."""
|
||||
arlo = hass.data.get(DATA_ARLO)
|
||||
if not arlo:
|
||||
@ -60,7 +59,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
for camera in arlo.cameras:
|
||||
cameras.append(ArloCam(hass, camera, config))
|
||||
|
||||
async_add_devices(cameras, True)
|
||||
add_devices(cameras, True)
|
||||
|
||||
|
||||
class ArloCam(Camera):
|
||||
|
@ -229,7 +229,7 @@ class GenericThermostat(ClimateDevice):
|
||||
"""List of available operation modes."""
|
||||
return self._operation_list
|
||||
|
||||
def set_operation_mode(self, operation_mode):
|
||||
async def async_set_operation_mode(self, operation_mode):
|
||||
"""Set operation mode."""
|
||||
if operation_mode == STATE_HEAT:
|
||||
self._current_operation = STATE_HEAT
|
||||
|
@ -135,7 +135,7 @@ class TestTemplateCover(unittest.TestCase):
|
||||
entity = self.hass.states.get('cover.test')
|
||||
attrs = dict()
|
||||
attrs['position'] = 42
|
||||
self.hass.states.async_set(
|
||||
self.hass.states.set(
|
||||
entity.entity_id, entity.state,
|
||||
attributes=attrs)
|
||||
self.hass.block_till_done()
|
||||
@ -148,7 +148,7 @@ class TestTemplateCover(unittest.TestCase):
|
||||
self.hass.block_till_done()
|
||||
entity = self.hass.states.get('cover.test')
|
||||
attrs['position'] = 0.0
|
||||
self.hass.states.async_set(
|
||||
self.hass.states.set(
|
||||
entity.entity_id, entity.state,
|
||||
attributes=attrs)
|
||||
self.hass.block_till_done()
|
||||
|
@ -309,7 +309,7 @@ def test_value_discovery_existing_entity(hass, mock_openzwave):
|
||||
'current_temperature'] is None
|
||||
|
||||
def mock_update(self):
|
||||
self.hass.async_add_job(self.async_update_ha_state)
|
||||
self.hass.add_job(self.async_update_ha_state)
|
||||
|
||||
with patch.object(zwave.node_entity.ZWaveBaseEntity,
|
||||
'maybe_schedule_update', new=mock_update):
|
||||
@ -356,7 +356,7 @@ def test_power_schemes(hass, mock_openzwave):
|
||||
'switch.mock_node_mock_value').attributes
|
||||
|
||||
def mock_update(self):
|
||||
self.hass.async_add_job(self.async_update_ha_state)
|
||||
self.hass.add_job(self.async_update_ha_state)
|
||||
|
||||
with patch.object(zwave.node_entity.ZWaveBaseEntity,
|
||||
'maybe_schedule_update', new=mock_update):
|
||||
|
Loading…
x
Reference in New Issue
Block a user