Add service configuration URL to MQTT (#57731)

This commit is contained in:
Franck Nijhof 2021-10-15 03:27:40 +02:00 committed by GitHub
parent e34fb4cfb9
commit eed9f67402
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 0 deletions

View file

@ -301,6 +301,7 @@ def test_entity_device_info_schema():
"name": "Beer",
"model": "Glass",
"sw_version": "0.1-beta",
"configuration_url": "http://example.com",
}
)
# full device info with via_device
@ -316,6 +317,7 @@ def test_entity_device_info_schema():
"model": "Glass",
"sw_version": "0.1-beta",
"via_device": "test-hub",
"configuration_url": "http://example.com",
}
)
# no identifiers
@ -334,6 +336,18 @@ def test_entity_device_info_schema():
{"identifiers": [], "connections": [], "name": "Beer"}
)
# not an valid URL
with pytest.raises(vol.Invalid):
MQTT_ENTITY_DEVICE_INFO_SCHEMA(
{
"manufacturer": "Whatever",
"name": "Beer",
"model": "Glass",
"sw_version": "0.1-beta",
"configuration_url": "fake://link",
}
)
async def test_receiving_non_utf8_message_gets_logged(
hass, mqtt_mock, calls, record_calls, caplog