Deprecate explicit entity_id in template platforms (#11123)

* Deprecate explicit entity_id in template platforms

* Use config validator for deprecation

* Fix copy/paste typos

* Also print the config value

* Add test for config validator

* Assert the module name that logged the message
This commit is contained in:
Anders Melchiorsen authored and Paulus Schoutsen committed 2018-01-10 00:06:26 -08:00
1 parent 88b70e964c
commit 9e0ca719ed
7 files changed
+64

No files matched your search

@@ -31,6 +31,11 @@ SENSOR_SCHEMA = vol.Schema({
vol.Optional(ATTR_ENTITY_ID): cv.entity_ids
})
SENSOR_SCHEMA = vol.All(
cv.deprecated(ATTR_ENTITY_ID),
SENSOR_SCHEMA,
)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_SENSORS): vol.Schema({cv.slug: SENSOR_SCHEMA}),
})