add_devices -> add_entities (#16171)

* add_devices -> add_entities

* Lint

* PyLint

* Revert external method in scsgate
This commit is contained in:
Paulus Schoutsen 2018-08-24 16:37:30 +02:00 committed by GitHub
parent 37fd438717
commit 994b829cb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
839 changed files with 2121 additions and 2008 deletions

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