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

+3 -2
View File
@@ -33,7 +33,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the file sensor."""
file_path = config.get(CONF_FILE_PATH)
name = config.get(CONF_NAME)
@@ -44,7 +45,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
value_template.hass = hass
if hass.config.is_allowed_path(file_path):
async_add_devices(
async_add_entities(
[FileSensor(name, file_path, unit, value_template)], True)
else:
_LOGGER.error("'%s' is not a whitelisted directory", file_path)