Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions homeassistant/components/knx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
CONFIG_SCHEMA = vol.Schema(
{
DOMAIN: vol.All(
# deprecated since 2021.3
cv.deprecated(CONF_KNX_CONFIG),
# deprecated since 2021.2
cv.deprecated(CONF_KNX_FIRE_EVENT),
cv.deprecated("fire_event_filter", replacement_key=CONF_KNX_EVENT_FILTER),
vol.Schema(
Expand Down Expand Up @@ -229,6 +232,15 @@ async def async_setup(hass, config):
"https://www.home-assistant.io/blog/2020/09/17/release-115/#breaking-changes"
)

# deprecation warning since 2021.3
if CONF_KNX_CONFIG in config[DOMAIN]:
_LOGGER.warning(
"The 'config_file' option will soon be deprecated. Please replace it with Home Assistant config schema "

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is deprecated (see code above).

Suggested change
"The 'config_file' option will soon be deprecated. Please replace it with Home Assistant config schema "
"The 'config_file' option is deprecated. Please replace it with Home Assistant config schema "

Please note, that having both a cv.deprecated and a custom message, will now cause the user to have duplicate warnings (with different messages).

Is that intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove cv.deprecated again if you like.

Would it be welcome if I changed cv.deprecated to accept custom messages in general?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove cv.deprecated again if you like.

I think it's better to choose one or the other. I don't think we should mailbomb a user with duplicate messages from a user experience perspective. However, I don't know if it was intentional or not, hence my question. So 🤷

Would it be welcome if I changed cv.deprecated to accept custom messages in general?

We didn't have had much need for it in general. As most are just removed after it has been automatically migrated or imported into the UI. KNX is a special case, so let's not add that for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this could be the first step to migrate knx to config_flow...
Thanks for review!

"directly in `configuration.yaml` (see https://www.home-assistant.io/integrations/knx/). \n"
"An online configuration converter tool for your `%s` is available at https://xknx.io/config-converter/",
config[DOMAIN][CONF_KNX_CONFIG],
)

hass.services.async_register(
DOMAIN,
SERVICE_KNX_SEND,
Expand Down