diff --git a/homeassistant/components/mqtt/alarm_control_panel.py b/homeassistant/components/mqtt/alarm_control_panel.py index 043fa62f6ef..09f735c72a0 100644 --- a/homeassistant/components/mqtt/alarm_control_panel.py +++ b/homeassistant/components/mqtt/alarm_control_panel.py @@ -41,6 +41,7 @@ from . import ( MqttEntityDeviceInfo, subscription, ) +from .debug_info import log_messages from .discovery import MQTT_DISCOVERY_NEW, clear_discovery_hash _LOGGER = logging.getLogger(__name__) @@ -167,6 +168,7 @@ class MqttAlarm( command_template.hass = self.hass @callback + @log_messages(self.hass, self.entity_id) def message_received(msg): """Run when new MQTT message has been received.""" payload = msg.payload diff --git a/homeassistant/components/mqtt/binary_sensor.py b/homeassistant/components/mqtt/binary_sensor.py index d268c12aa87..c7595de0eeb 100644 --- a/homeassistant/components/mqtt/binary_sensor.py +++ b/homeassistant/components/mqtt/binary_sensor.py @@ -37,6 +37,7 @@ from . import ( MqttEntityDeviceInfo, subscription, ) +from .debug_info import log_messages from .discovery import MQTT_DISCOVERY_NEW, clear_discovery_hash _LOGGER = logging.getLogger(__name__) @@ -155,6 +156,7 @@ class MqttBinarySensor( self.async_write_ha_state() @callback + @log_messages(self.hass, self.entity_id) def state_message_received(msg): """Handle a new received MQTT state message.""" payload = msg.payload diff --git a/homeassistant/components/mqtt/camera.py b/homeassistant/components/mqtt/camera.py index a75ae33f861..1bfb248d94a 100644 --- a/homeassistant/components/mqtt/camera.py +++ b/homeassistant/components/mqtt/camera.py @@ -21,6 +21,7 @@ from . import ( MqttEntityDeviceInfo, subscription, ) +from .debug_info import log_messages from .discovery import MQTT_DISCOVERY_NEW, clear_discovery_hash _LOGGER = logging.getLogger(__name__) @@ -116,6 +117,7 @@ class MqttCamera( """(Re)Subscribe to topics.""" @callback + @log_messages(self.hass, self.entity_id) def message_received(msg): """Handle new MQTT messages.""" self._last_image = msg.payload diff --git a/homeassistant/components/mqtt/climate.py b/homeassistant/components/mqtt/climate.py index 46404de0c8a..0216302c651 100644 --- a/homeassistant/components/mqtt/climate.py +++ b/homeassistant/components/mqtt/climate.py @@ -60,6 +60,7 @@ from . import ( MqttEntityDeviceInfo, subscription, ) +from .debug_info import log_messages from .discovery import MQTT_DISCOVERY_NEW, clear_discovery_hash _LOGGER = logging.getLogger(__name__) @@ -384,6 +385,7 @@ class MqttClimate( return template(msg.payload) @callback + @log_messages(self.hass, self.entity_id) def handle_action_received(msg): """Handle receiving action via MQTT.""" payload = render_template(msg, CONF_ACTION_TEMPLATE) @@ -405,6 +407,7 @@ class MqttClimate( _LOGGER.error("Could not parse temperature from %s", payload) @callback + @log_messages(self.hass, self.entity_id) def handle_current_temperature_received(msg): """Handle current temperature coming via MQTT.""" handle_temperature_received( @@ -416,6 +419,7 @@ class MqttClimate( ) @callback + @log_messages(self.hass, self.entity_id) def handle_target_temperature_received(msg): """Handle target temperature coming via MQTT.""" handle_temperature_received(msg, CONF_TEMP_STATE_TEMPLATE, "_target_temp") @@ -425,6 +429,7 @@ class MqttClimate( ) @callback + @log_messages(self.hass, self.entity_id) def handle_temperature_low_received(msg): """Handle target temperature low coming via MQTT.""" handle_temperature_received( @@ -436,6 +441,7 @@ class MqttClimate( ) @callback + @log_messages(self.hass, self.entity_id) def handle_temperature_high_received(msg): """Handle target temperature high coming via MQTT.""" handle_temperature_received( @@ -458,6 +464,7 @@ class MqttClimate( self.async_write_ha_state() @callback + @log_messages(self.hass, self.entity_id) def handle_current_mode_received(msg): """Handle receiving mode via MQTT.""" handle_mode_received( @@ -467,6 +474,7 @@ class MqttClimate( add_subscription(topics, CONF_MODE_STATE_TOPIC, handle_current_mode_received) @callback + @log_messages(self.hass, self.entity_id) def handle_fan_mode_received(msg): """Handle receiving fan mode via MQTT.""" handle_mode_received( @@ -479,6 +487,7 @@ class MqttClimate( add_subscription(topics, CONF_FAN_MODE_STATE_TOPIC, handle_fan_mode_received) @callback + @log_messages(self.hass, self.entity_id) def handle_swing_mode_received(msg): """Handle receiving swing mode via MQTT.""" handle_mode_received( @@ -514,6 +523,7 @@ class MqttClimate( self.async_write_ha_state() @callback + @log_messages(self.hass, self.entity_id) def handle_away_mode_received(msg): """Handle receiving away mode via MQTT.""" handle_onoff_mode_received(msg, CONF_AWAY_MODE_STATE_TEMPLATE, "_away") @@ -521,6 +531,7 @@ class MqttClimate( add_subscription(topics, CONF_AWAY_MODE_STATE_TOPIC, handle_away_mode_received) @callback + @log_messages(self.hass, self.entity_id) def handle_aux_mode_received(msg): """Handle receiving aux mode via MQTT.""" handle_onoff_mode_received(msg, CONF_AUX_STATE_TEMPLATE, "_aux") @@ -528,6 +539,7 @@ class MqttClimate( add_subscription(topics, CONF_AUX_STATE_TOPIC, handle_aux_mode_received) @callback + @log_messages(self.hass, self.entity_id) def handle_hold_mode_received(msg): """Handle receiving hold mode via MQTT.""" payload = render_template(msg, CONF_HOLD_STATE_TEMPLATE) diff --git a/homeassistant/components/mqtt/cover.py b/homeassistant/components/mqtt/cover.py index a7a39678192..3081c1d0d9f 100644 --- a/homeassistant/components/mqtt/cover.py +++ b/homeassistant/components/mqtt/cover.py @@ -49,6 +49,7 @@ from . import ( MqttEntityDeviceInfo, subscription, ) +from .debug_info import log_messages from .discovery import MQTT_DISCOVERY_NEW, clear_discovery_hash _LOGGER = logging.getLogger(__name__) @@ -268,7 +269,8 @@ class MqttCover( topics = {} @callback - def tilt_updated(msg): + @log_messages(self.hass, self.entity_id) + def tilt_message_received(msg): """Handle tilt updates.""" payload = msg.payload if tilt_status_template is not None: @@ -287,6 +289,7 @@ class MqttCover( self.async_write_ha_state() @callback + @log_messages(self.hass, self.entity_id) def state_message_received(msg): """Handle new MQTT state messages.""" payload = msg.payload @@ -311,6 +314,7 @@ class MqttCover( self.async_write_ha_state() @callback + @log_messages(self.hass, self.entity_id) def position_message_received(msg): """Handle new MQTT state messages.""" payload = msg.payload @@ -354,7 +358,7 @@ class MqttCover( self._tilt_value = STATE_UNKNOWN topics["tilt_status_topic"] = { "topic": self._config.get(CONF_TILT_STATUS_TOPIC), - "msg_callback": tilt_updated, + "msg_callback": tilt_message_received, "qos": self._config[CONF_QOS], } diff --git a/homeassistant/components/mqtt/fan.py b/homeassistant/components/mqtt/fan.py index b50bdf9734b..ec7c729d597 100644 --- a/homeassistant/components/mqtt/fan.py +++ b/homeassistant/components/mqtt/fan.py @@ -40,6 +40,7 @@ from . import ( MqttEntityDeviceInfo, subscription, ) +from .debug_info import log_messages from .discovery import MQTT_DISCOVERY_NEW, clear_discovery_hash _LOGGER = logging.getLogger(__name__) @@ -249,6 +250,7 @@ class MqttFan( templates[key] = tpl.async_render_with_possible_json_value @callback + @log_messages(self.hass, self.entity_id) def state_received(msg): """Handle new received MQTT message.""" payload = templates[CONF_STATE](msg.payload) @@ -266,6 +268,7 @@ class MqttFan( } @callback + @log_messages(self.hass, self.entity_id) def speed_received(msg): """Handle new received MQTT message for the speed.""" payload = templates[ATTR_SPEED](msg.payload) @@ -288,6 +291,7 @@ class MqttFan( self._speed = SPEED_OFF @callback + @log_messages(self.hass, self.entity_id) def oscillation_received(msg): """Handle new received MQTT message for the oscillation.""" payload = templates[OSCILLATION](msg.payload) diff --git a/homeassistant/components/mqtt/light/schema_basic.py b/homeassistant/components/mqtt/light/schema_basic.py index 4b47014af48..e6a7f827f1e 100644 --- a/homeassistant/components/mqtt/light/schema_basic.py +++ b/homeassistant/components/mqtt/light/schema_basic.py @@ -51,6 +51,7 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.restore_state import RestoreEntity import homeassistant.util.color as color_util +from ..debug_info import log_messages from .schema import MQTT_LIGHT_SCHEMA_SCHEMA _LOGGER = logging.getLogger(__name__) @@ -292,6 +293,7 @@ class MqttLight( last_state = await self.async_get_last_state() @callback + @log_messages(self.hass, self.entity_id) def state_received(msg): """Handle new MQTT messages.""" payload = templates[CONF_STATE](msg.payload) @@ -315,6 +317,7 @@ class MqttLight( self._state = last_state.state == STATE_ON @callback + @log_messages(self.hass, self.entity_id) def brightness_received(msg): """Handle new MQTT messages for the brightness.""" payload = templates[CONF_BRIGHTNESS](msg.payload) @@ -346,6 +349,7 @@ class MqttLight( self._brightness = None @callback + @log_messages(self.hass, self.entity_id) def rgb_received(msg): """Handle new MQTT messages for RGB.""" payload = templates[CONF_RGB](msg.payload) @@ -377,6 +381,7 @@ class MqttLight( self._hs = (0, 0) @callback + @log_messages(self.hass, self.entity_id) def color_temp_received(msg): """Handle new MQTT messages for color temperature.""" payload = templates[CONF_COLOR_TEMP](msg.payload) @@ -406,6 +411,7 @@ class MqttLight( self._color_temp = None @callback + @log_messages(self.hass, self.entity_id) def effect_received(msg): """Handle new MQTT messages for effect.""" payload = templates[CONF_EFFECT](msg.payload) @@ -435,6 +441,7 @@ class MqttLight( self._effect = None @callback + @log_messages(self.hass, self.entity_id) def hs_received(msg): """Handle new MQTT messages for hs color.""" payload = templates[CONF_HS](msg.payload) @@ -466,6 +473,7 @@ class MqttLight( self._hs = (0, 0) @callback + @log_messages(self.hass, self.entity_id) def white_value_received(msg): """Handle new MQTT messages for white value.""" payload = templates[CONF_WHITE_VALUE](msg.payload) @@ -497,6 +505,7 @@ class MqttLight( self._white_value = None @callback + @log_messages(self.hass, self.entity_id) def xy_received(msg): """Handle new MQTT messages for xy color.""" payload = templates[CONF_XY](msg.payload) diff --git a/homeassistant/components/mqtt/light/schema_json.py b/homeassistant/components/mqtt/light/schema_json.py index 0af5aaf2c76..924559e3e90 100644 --- a/homeassistant/components/mqtt/light/schema_json.py +++ b/homeassistant/components/mqtt/light/schema_json.py @@ -54,6 +54,7 @@ from homeassistant.helpers.restore_state import RestoreEntity from homeassistant.helpers.typing import ConfigType import homeassistant.util.color as color_util +from ..debug_info import log_messages from .schema import MQTT_LIGHT_SCHEMA_SCHEMA from .schema_basic import CONF_BRIGHTNESS_SCALE @@ -234,6 +235,7 @@ class MqttLightJson( last_state = await self.async_get_last_state() @callback + @log_messages(self.hass, self.entity_id) def state_received(msg): """Handle new MQTT messages.""" values = json.loads(msg.payload) diff --git a/homeassistant/components/mqtt/light/schema_template.py b/homeassistant/components/mqtt/light/schema_template.py index cd3e704f624..25de6862bdb 100644 --- a/homeassistant/components/mqtt/light/schema_template.py +++ b/homeassistant/components/mqtt/light/schema_template.py @@ -45,6 +45,7 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.restore_state import RestoreEntity import homeassistant.util.color as color_util +from ..debug_info import log_messages from .schema import MQTT_LIGHT_SCHEMA_SCHEMA _LOGGER = logging.getLogger(__name__) @@ -215,6 +216,7 @@ class MqttTemplate( last_state = await self.async_get_last_state() @callback + @log_messages(self.hass, self.entity_id) def state_received(msg): """Handle new MQTT messages.""" state = self._templates[ diff --git a/homeassistant/components/mqtt/lock.py b/homeassistant/components/mqtt/lock.py index 89f005b7469..378f1b8fbcb 100644 --- a/homeassistant/components/mqtt/lock.py +++ b/homeassistant/components/mqtt/lock.py @@ -29,6 +29,7 @@ from . import ( MqttEntityDeviceInfo, subscription, ) +from .debug_info import log_messages from .discovery import MQTT_DISCOVERY_NEW, clear_discovery_hash _LOGGER = logging.getLogger(__name__) @@ -156,6 +157,7 @@ class MqttLock( value_template.hass = self.hass @callback + @log_messages(self.hass, self.entity_id) def message_received(msg): """Handle new MQTT messages.""" payload = msg.payload diff --git a/homeassistant/components/mqtt/switch.py b/homeassistant/components/mqtt/switch.py index 32066c67b7a..bc1f4a038b4 100644 --- a/homeassistant/components/mqtt/switch.py +++ b/homeassistant/components/mqtt/switch.py @@ -34,6 +34,7 @@ from . import ( MqttEntityDeviceInfo, subscription, ) +from .debug_info import log_messages from .discovery import MQTT_DISCOVERY_NEW, clear_discovery_hash _LOGGER = logging.getLogger(__name__) @@ -162,6 +163,7 @@ class MqttSwitch( template.hass = self.hass @callback + @log_messages(self.hass, self.entity_id) def state_message_received(msg): """Handle new MQTT state messages.""" payload = msg.payload diff --git a/homeassistant/components/mqtt/vacuum/schema_legacy.py b/homeassistant/components/mqtt/vacuum/schema_legacy.py index 7679b97d62e..687fefa94e2 100644 --- a/homeassistant/components/mqtt/vacuum/schema_legacy.py +++ b/homeassistant/components/mqtt/vacuum/schema_legacy.py @@ -32,6 +32,7 @@ from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.icon import icon_for_battery_level +from ..debug_info import log_messages from .schema import MQTT_VACUUM_SCHEMA, services_to_strings, strings_to_services _LOGGER = logging.getLogger(__name__) @@ -280,6 +281,7 @@ class MqttVacuum( tpl.hass = self.hass @callback + @log_messages(self.hass, self.entity_id) def message_received(msg): """Handle new MQTT message.""" if ( diff --git a/homeassistant/components/mqtt/vacuum/schema_state.py b/homeassistant/components/mqtt/vacuum/schema_state.py index 126a2432cb0..cbaf8d43a77 100644 --- a/homeassistant/components/mqtt/vacuum/schema_state.py +++ b/homeassistant/components/mqtt/vacuum/schema_state.py @@ -45,6 +45,7 @@ from homeassistant.const import ( from homeassistant.core import callback import homeassistant.helpers.config_validation as cv +from ..debug_info import log_messages from .schema import MQTT_VACUUM_SCHEMA, services_to_strings, strings_to_services _LOGGER = logging.getLogger(__name__) @@ -246,6 +247,7 @@ class MqttStateVacuum( topics = {} @callback + @log_messages(self.hass, self.entity_id) def state_message_received(msg): """Handle state MQTT message.""" payload = msg.payload diff --git a/tests/components/mqtt/test_alarm_control_panel.py b/tests/components/mqtt/test_alarm_control_panel.py index 45c123fa2fe..ba1855247fe 100644 --- a/tests/components/mqtt/test_alarm_control_panel.py +++ b/tests/components/mqtt/test_alarm_control_panel.py @@ -21,6 +21,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -494,3 +495,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, alarm_control_panel.DOMAIN, DEFAULT_CONFIG ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, alarm_control_panel.DOMAIN, DEFAULT_CONFIG + ) diff --git a/tests/components/mqtt/test_binary_sensor.py b/tests/components/mqtt/test_binary_sensor.py index a73919844c1..07a1c8b6e5f 100644 --- a/tests/components/mqtt/test_binary_sensor.py +++ b/tests/components/mqtt/test_binary_sensor.py @@ -23,6 +23,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -508,3 +509,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, binary_sensor.DOMAIN, DEFAULT_CONFIG ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, binary_sensor.DOMAIN, DEFAULT_CONFIG + ) diff --git a/tests/components/mqtt/test_camera.py b/tests/components/mqtt/test_camera.py index 21f552b4163..cefeda04097 100644 --- a/tests/components/mqtt/test_camera.py +++ b/tests/components/mqtt/test_camera.py @@ -13,6 +13,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -207,3 +208,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, camera.DOMAIN, DEFAULT_CONFIG ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, camera.DOMAIN, DEFAULT_CONFIG, "test_topic", b"ON" + ) diff --git a/tests/components/mqtt/test_climate.py b/tests/components/mqtt/test_climate.py index ce21aa53d27..d5b303a51f0 100644 --- a/tests/components/mqtt/test_climate.py +++ b/tests/components/mqtt/test_climate.py @@ -33,6 +33,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -908,6 +909,20 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): ) +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + config = { + CLIMATE_DOMAIN: { + "platform": "mqtt", + "name": "test", + "mode_state_topic": "test-topic", + } + } + await help_test_entity_debug_info_message( + hass, mqtt_mock, CLIMATE_DOMAIN, config, "test-topic" + ) + + async def test_precision_default(hass, mqtt_mock): """Test that setting precision to tenths works as intended.""" assert await async_setup_component(hass, CLIMATE_DOMAIN, DEFAULT_CONFIG) diff --git a/tests/components/mqtt/test_cover.py b/tests/components/mqtt/test_cover.py index 7749c419ca0..7d0753a9de2 100644 --- a/tests/components/mqtt/test_cover.py +++ b/tests/components/mqtt/test_cover.py @@ -30,6 +30,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -1762,3 +1763,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, cover.DOMAIN, DEFAULT_CONFIG ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, cover.DOMAIN, DEFAULT_CONFIG + ) diff --git a/tests/components/mqtt/test_fan.py b/tests/components/mqtt/test_fan.py index 460c99618bd..6b774e9d5ce 100644 --- a/tests/components/mqtt/test_fan.py +++ b/tests/components/mqtt/test_fan.py @@ -11,6 +11,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -509,3 +510,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, fan.DOMAIN, DEFAULT_CONFIG ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, fan.DOMAIN, DEFAULT_CONFIG + ) diff --git a/tests/components/mqtt/test_legacy_vacuum.py b/tests/components/mqtt/test_legacy_vacuum.py index 14ab79b2d20..0ddb661cf85 100644 --- a/tests/components/mqtt/test_legacy_vacuum.py +++ b/tests/components/mqtt/test_legacy_vacuum.py @@ -27,6 +27,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -629,3 +630,20 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2 ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + config = { + vacuum.DOMAIN: { + "platform": "mqtt", + "name": "test", + "battery_level_topic": "test-topic", + "battery_level_template": "{{ value_json.battery_level }}", + "command_topic": "command-topic", + "availability_topic": "avty-topic", + } + } + await help_test_entity_debug_info_message( + hass, mqtt_mock, vacuum.DOMAIN, config, "test-topic" + ) diff --git a/tests/components/mqtt/test_light.py b/tests/components/mqtt/test_light.py index bc4f5fc3393..45473d6f448 100644 --- a/tests/components/mqtt/test_light.py +++ b/tests/components/mqtt/test_light.py @@ -170,6 +170,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -1358,3 +1359,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, light.DOMAIN, DEFAULT_CONFIG ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, light.DOMAIN, DEFAULT_CONFIG + ) diff --git a/tests/components/mqtt/test_light_json.py b/tests/components/mqtt/test_light_json.py index f71791e019f..1223f3525c4 100644 --- a/tests/components/mqtt/test_light_json.py +++ b/tests/components/mqtt/test_light_json.py @@ -109,6 +109,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -1134,3 +1135,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, light.DOMAIN, DEFAULT_CONFIG ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, light.DOMAIN, DEFAULT_CONFIG + ) diff --git a/tests/components/mqtt/test_light_template.py b/tests/components/mqtt/test_light_template.py index c9612a7ded7..37617192dd5 100644 --- a/tests/components/mqtt/test_light_template.py +++ b/tests/components/mqtt/test_light_template.py @@ -46,6 +46,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -957,3 +958,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, light.DOMAIN, DEFAULT_CONFIG ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, light.DOMAIN, DEFAULT_CONFIG + ) diff --git a/tests/components/mqtt/test_lock.py b/tests/components/mqtt/test_lock.py index 151021a45f8..803fd6c3ab3 100644 --- a/tests/components/mqtt/test_lock.py +++ b/tests/components/mqtt/test_lock.py @@ -11,6 +11,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -399,3 +400,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, lock.DOMAIN, DEFAULT_CONFIG ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, lock.DOMAIN, DEFAULT_CONFIG + ) diff --git a/tests/components/mqtt/test_state_vacuum.py b/tests/components/mqtt/test_state_vacuum.py index ecb38ef5774..367b9ceda8a 100644 --- a/tests/components/mqtt/test_state_vacuum.py +++ b/tests/components/mqtt/test_state_vacuum.py @@ -38,6 +38,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -454,3 +455,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2 ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2 + ) diff --git a/tests/components/mqtt/test_switch.py b/tests/components/mqtt/test_switch.py index d8ca8031390..1aaeb154dc2 100644 --- a/tests/components/mqtt/test_switch.py +++ b/tests/components/mqtt/test_switch.py @@ -15,6 +15,7 @@ from .test_common import ( help_test_discovery_removal, help_test_discovery_update, help_test_discovery_update_attr, + help_test_entity_debug_info_message, help_test_entity_device_info_remove, help_test_entity_device_info_update, help_test_entity_device_info_with_connection, @@ -366,3 +367,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock): await help_test_entity_id_update_discovery_update( hass, mqtt_mock, switch.DOMAIN, DEFAULT_CONFIG ) + + +async def test_entity_debug_info_message(hass, mqtt_mock): + """Test MQTT debug info.""" + await help_test_entity_debug_info_message( + hass, mqtt_mock, switch.DOMAIN, DEFAULT_CONFIG + )