diff --git a/homeassistant/components/light/reproduce_state.py b/homeassistant/components/light/reproduce_state.py index 59a4b0306d0..9a6b22b51a2 100644 --- a/homeassistant/components/light/reproduce_state.py +++ b/homeassistant/components/light/reproduce_state.py @@ -64,7 +64,10 @@ DEPRECATED_GROUP = [ ATTR_TRANSITION, ] -DEPRECATION_WARNING = "The use of other attributes than device state attributes is deprecated and will be removed in a future release. Read the logs for further details: https://www.home-assistant.io/integrations/scene/" +DEPRECATION_WARNING = ( + "The use of other attributes than device state attributes is deprecated and will be removed in a future release. " + "Invalid attributes are %s. Read the logs for further details: https://www.home-assistant.io/integrations/scene/" +) async def _async_reproduce_state( @@ -84,8 +87,9 @@ async def _async_reproduce_state( return # Warn if deprecated attributes are used - if any(attr in DEPRECATED_GROUP for attr in state.attributes): - _LOGGER.warning(DEPRECATION_WARNING) + deprecated_attrs = [attr for attr in state.attributes if attr in DEPRECATED_GROUP] + if deprecated_attrs: + _LOGGER.warning(DEPRECATION_WARNING, deprecated_attrs) # Return if we are already at the right state. if cur_state.state == state.state and all( diff --git a/tests/components/light/test_reproduce_state.py b/tests/components/light/test_reproduce_state.py index 250a0fe26a8..1c40f352ff0 100644 --- a/tests/components/light/test_reproduce_state.py +++ b/tests/components/light/test_reproduce_state.py @@ -166,4 +166,4 @@ async def test_deprecation_warning(hass, caplog): [State("light.entity_off", "on", {"brightness_pct": 80})], blocking=True ) assert len(turn_on_calls) == 1 - assert DEPRECATION_WARNING in caplog.text + assert DEPRECATION_WARNING % ["brightness_pct"] in caplog.text