Allow extra keys in MQTT discovery messages (#58390)
* Allow extra keys in MQTT discovery messages * Remove extra keys
This commit is contained in:
parent
a8a8b532d0
commit
640a7fee9d
44 changed files with 628 additions and 480 deletions
|
@ -268,6 +268,8 @@ PLATFORM_SCHEMA = SCHEMA_BASE.extend(
|
|||
}
|
||||
).extend(MQTT_ENTITY_COMMON_SCHEMA.schema)
|
||||
|
||||
DISCOVERY_SCHEMA = PLATFORM_SCHEMA.extend({}, extra=vol.REMOVE_EXTRA)
|
||||
|
||||
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistant, async_add_entities, config: ConfigType, discovery_info=None
|
||||
|
@ -282,7 +284,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
setup = functools.partial(
|
||||
_async_setup_entity, hass, async_add_entities, config_entry=config_entry
|
||||
)
|
||||
await async_setup_entry_helper(hass, climate.DOMAIN, setup, PLATFORM_SCHEMA)
|
||||
await async_setup_entry_helper(hass, climate.DOMAIN, setup, DISCOVERY_SCHEMA)
|
||||
|
||||
|
||||
async def _async_setup_entity(
|
||||
|
@ -319,7 +321,7 @@ class MqttClimate(MqttEntity, ClimateEntity):
|
|||
@staticmethod
|
||||
def config_schema():
|
||||
"""Return the config schema."""
|
||||
return PLATFORM_SCHEMA
|
||||
return DISCOVERY_SCHEMA
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
"""Handle being added to Home Assistant."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue