Skip to content

Commit

Permalink
Update deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
alengwenus committed Oct 26, 2024
1 parent 577c4e5 commit e4d9a4b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
21 changes: 19 additions & 2 deletions homeassistant/components/lcn/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ def __init__(self, config: ConfigType, config_entry: ConfigEntry) -> None:
async def async_added_to_hass(self) -> None:
"""Run when entity about to be added to hass."""
await super().async_added_to_hass()

async_create_issue(
self.hass,
DOMAIN,
"deprecated_regulatorlock_sensor",
breaks_in_ha_version="2025.2.0",
is_fixable=False,
is_persistent=False,
issue_domain=DOMAIN,
severity=IssueSeverity.WARNING,
translation_key="deprecated_regulatorlock_sensor",
translation_placeholders={
"domain": DOMAIN,
"integration_title": "LCN",
},
)

if not self.device_connection.is_group:
await self.device_connection.activate_status_request_handler(
self.setpoint_variable
Expand Down Expand Up @@ -161,13 +178,13 @@ async def async_added_to_hass(self) -> None:
async_create_issue(
self.hass,
DOMAIN,
"deprecated_lock_key_sensor",
"deprecated_keylock_sensor",
breaks_in_ha_version="2025.2.0",
is_fixable=False,
is_persistent=False,
issue_domain=DOMAIN,
severity=IssueSeverity.WARNING,
translation_key="deprecated_lock_key_sensor",
translation_key="deprecated_keylock_sensor",
translation_placeholders={
"domain": DOMAIN,
"integration_title": "LCN",
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/lcn/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@
"title": "Unable to connect to PCHK.",
"description": "Configuring LCN using YAML is being removed but there was an error importing your YAML configuration.\n\nEnsure the connection (IP and port) to the LCN bus coupler is correct.\n\nConsider removing the LCN YAML configuration from your configuration.yaml file and continue to [set up the integration]({url}) manually."
},
"deprecated_lock_key_sensor": {
"deprecated_regulatorlock_sensor": {
"title": "The binary sensor for regulator locks is deprecated.",
"description": "The binary sensor entity for regulator locks has been deprecated and replaced with a regulator lock switch. Please change your configuration accordingly."
},
"deprecated_keylock_sensor": {
"title": "The binary sensor for key locks is deprecated.",
"description": "The binary sensor entity for key locks has been deprecated and replaced with a key lock switch. Please change your configuration accordingly."
}
Expand Down

0 comments on commit e4d9a4b

Please sign in to comment.