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:
1 parent
88b70e964c
commit
9e0ca719ed
7 files changed
+64
No files matched your search
@@ -38,6 +38,11 @@ SENSOR_SCHEMA = vol.Schema({
|
||||
vol.All(cv.time_period, cv.positive_timedelta),
|
||||
})
|
||||
|
||||
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}),
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user