From 15900094a1615b877b2c755098db73b596f9455b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 2 Nov 2019 01:30:37 +0100 Subject: [PATCH] Update MQTT sensor test (#28449) --- tests/components/mqtt/test_sensor.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/components/mqtt/test_sensor.py b/tests/components/mqtt/test_sensor.py index f46d8ab7f71..cd55a08482d 100644 --- a/tests/components/mqtt/test_sensor.py +++ b/tests/components/mqtt/test_sensor.py @@ -268,12 +268,12 @@ async def test_setting_sensor_attribute_via_legacy_mqtt_json_message(hass, mqtt_ "name": "test", "state_topic": "test-topic", "unit_of_measurement": "fav unit", - "json_attributes": "val", + "json_attributes_topic": "test-attributes-topic", } }, ) - async_fire_mqtt_message(hass, "test-topic", '{ "val": "100" }') + async_fire_mqtt_message(hass, "test-attributes-topic", '{ "val": "100" }') state = hass.states.get("sensor.test") assert state.attributes.get("val") == "100" @@ -290,12 +290,12 @@ async def test_update_with_legacy_json_attrs_not_dict(hass, mqtt_mock, caplog): "name": "test", "state_topic": "test-topic", "unit_of_measurement": "fav unit", - "json_attributes": "val", + "json_attributes_topic": "test-attributes-topic", } }, ) - async_fire_mqtt_message(hass, "test-topic", '[ "list", "of", "things"]') + async_fire_mqtt_message(hass, "test-attributes-topic", '[ "list", "of", "things"]') state = hass.states.get("sensor.test") assert state.attributes.get("val") is None @@ -313,12 +313,12 @@ async def test_update_with_legacy_json_attrs_bad_JSON(hass, mqtt_mock, caplog): "name": "test", "state_topic": "test-topic", "unit_of_measurement": "fav unit", - "json_attributes": "val", + "json_attributes_topic": "test-attributes-topic", } }, ) - async_fire_mqtt_message(hass, "test-topic", "This is not JSON") + async_fire_mqtt_message(hass, "test-attributes-topic", "This is not JSON") state = hass.states.get("sensor.test") assert state.attributes.get("val") is None