add_devices -> add_entities (#16171)

* add_devices -> add_entities

* Lint

* PyLint

* Revert external method in scsgate
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-08-24 16:37:30 +02:00
1 parent 37fd438717
commit 994b829cb4
839 files changed
+2121 -2008

No files matched your search

+9 -9
View File
@@ -128,24 +128,24 @@ def test_setup_platform(hass, mock_openzwave):
mock_device = MagicMock()
hass.data[DATA_NETWORK] = MagicMock()
hass.data[zwave.DATA_DEVICES] = {456: mock_device}
async_add_devices = MagicMock()
async_add_entities = MagicMock()
result = yield from zwave.async_setup_platform(
hass, None, async_add_devices, None)
hass, None, async_add_entities, None)
assert not result
assert not async_add_devices.called
assert not async_add_entities.called
result = yield from zwave.async_setup_platform(
hass, None, async_add_devices, {const.DISCOVERY_DEVICE: 123})
hass, None, async_add_entities, {const.DISCOVERY_DEVICE: 123})
assert not result
assert not async_add_devices.called
assert not async_add_entities.called
result = yield from zwave.async_setup_platform(
hass, None, async_add_devices, {const.DISCOVERY_DEVICE: 456})
hass, None, async_add_entities, {const.DISCOVERY_DEVICE: 456})
assert result
assert async_add_devices.called
assert len(async_add_devices.mock_calls) == 1
assert async_add_devices.mock_calls[0][1][0] == [mock_device]
assert async_add_entities.called
assert len(async_add_entities.mock_calls) == 1
assert async_add_entities.mock_calls[0][1][0] == [mock_device]
@asyncio.coroutine