Use PLATFORM_SCHEMA_BASE as base schema for additional components. (#20578)

* Disable extra=vol.ALLOW_EXTRA for additional platforms.

* Remove PLATFORM_SCHEMA_2

* Add entity_namespace to base platform schema
This commit is contained in:
emontnemery 2019-02-05 06:52:19 +01:00 committed by Paulus Schoutsen
parent 154b401d0a
commit b1faad0a50
32 changed files with 75 additions and 81 deletions

View file

@ -679,7 +679,8 @@ async def test_setting_attribute_via_mqtt_json_message(hass, mqtt_mock):
climate.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
'state_topic': 'test-topic',
'power_state_topic': 'test-topic',
'power_command_topic': 'test_topic',
'json_attributes_topic': 'attr-topic'
}
})
@ -697,7 +698,8 @@ async def test_update_with_json_attrs_not_dict(hass, mqtt_mock, caplog):
climate.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
'state_topic': 'test-topic',
'power_state_topic': 'test-topic',
'power_command_topic': 'test_topic',
'json_attributes_topic': 'attr-topic'
}
})
@ -716,7 +718,8 @@ async def test_update_with_json_attrs_bad_JSON(hass, mqtt_mock, caplog):
climate.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
'state_topic': 'test-topic',
'power_state_topic': 'test-topic',
'power_command_topic': 'test_topic',
'json_attributes_topic': 'attr-topic'
}
})
@ -735,12 +738,14 @@ async def test_discovery_update_attr(hass, mqtt_mock, caplog):
await async_start(hass, 'homeassistant', {}, entry)
data1 = (
'{ "name": "Beer",'
' "command_topic": "test_topic",'
' "power_state_topic": "test-topic",'
' "power_command_topic": "test_topic",'
' "json_attributes_topic": "attr-topic1" }'
)
data2 = (
'{ "name": "Beer",'
' "command_topic": "test_topic",'
' "power_state_topic": "test-topic",'
' "power_command_topic": "test_topic",'
' "json_attributes_topic": "attr-topic2" }'
)
async_fire_mqtt_message(hass, 'homeassistant/climate/bla/config',
@ -780,14 +785,14 @@ async def test_unique_id(hass):
climate.DOMAIN: [{
'platform': 'mqtt',
'name': 'Test 1',
'status_topic': 'test-topic',
'command_topic': 'test_topic',
'power_state_topic': 'test-topic',
'power_command_topic': 'test_topic',
'unique_id': 'TOTALLY_UNIQUE'
}, {
'platform': 'mqtt',
'name': 'Test 2',
'status_topic': 'test-topic',
'command_topic': 'test_topic',
'power_state_topic': 'test-topic',
'power_command_topic': 'test_topic',
'unique_id': 'TOTALLY_UNIQUE'
}]
})
@ -891,8 +896,6 @@ async def test_entity_device_info_with_identifier(hass, mqtt_mock):
data = json.dumps({
'platform': 'mqtt',
'name': 'Test 1',
'state_topic': 'test-topic',
'command_topic': 'test-topic',
'device': {
'identifiers': ['helloworld'],
'connections': [
@ -930,8 +933,8 @@ async def test_entity_device_info_update(hass, mqtt_mock):
config = {
'platform': 'mqtt',
'name': 'Test 1',
'state_topic': 'test-topic',
'command_topic': 'test-command-topic',
'power_state_topic': 'test-topic',
'power_command_topic': 'test-command-topic',
'device': {
'identifiers': ['helloworld'],
'connections': [