Deprecate set_doorbell_message UniFi Protect service (#83675)

This commit is contained in:
Christopher Bailey 2022-12-26 14:19:34 -05:00 committed by GitHub
parent 101118a60e
commit b96330df03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 4 deletions

View File

@ -32,7 +32,11 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ENTITY_ID from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_validation as cv, entity_platform from homeassistant.helpers import (
config_validation as cv,
entity_platform,
issue_registry as ir,
)
from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import EntityCategory from homeassistant.helpers.entity import EntityCategory
from homeassistant.util.dt import utcnow from homeassistant.util.dt import utcnow
@ -430,6 +434,20 @@ class ProtectSelects(ProtectDeviceEntity, SelectEntity):
async def async_set_doorbell_message(self, message: str, duration: str) -> None: async def async_set_doorbell_message(self, message: str, duration: str) -> None:
"""Set LCD Message on Doorbell display.""" """Set LCD Message on Doorbell display."""
ir.async_create_issue(
self.hass,
DOMAIN,
"deprecated_service_set_doorbell_message",
breaks_in_ha_version="2023.3.0",
is_fixable=True,
is_persistent=True,
severity=ir.IssueSeverity.WARNING,
translation_placeholders={
"link": "https://www.home-assistant.io/integrations/text#service-textset_value"
},
translation_key="deprecated_service_set_doorbell_message",
)
if self.entity_description.device_class != DEVICE_CLASS_LCD_MESSAGE: if self.entity_description.device_class != DEVICE_CLASS_LCD_MESSAGE:
raise HomeAssistantError("Not a doorbell text select entity") raise HomeAssistantError("Not a doorbell text select entity")

View File

@ -75,6 +75,17 @@
"ea_setup_failed": { "ea_setup_failed": {
"title": "Setup error using Early Access version", "title": "Setup error using Early Access version",
"description": "You are using v{version} of UniFi Protect which is an Early Access version. An unrecoverable error occurred while trying to load the integration. Please [downgrade to a stable version](https://www.home-assistant.io/integrations/unifiprotect#downgrading-unifi-protect) of UniFi Protect to continue using the integration.\n\nError: {error}" "description": "You are using v{version} of UniFi Protect which is an Early Access version. An unrecoverable error occurred while trying to load the integration. Please [downgrade to a stable version](https://www.home-assistant.io/integrations/unifiprotect#downgrading-unifi-protect) of UniFi Protect to continue using the integration.\n\nError: {error}"
},
"deprecated_service_set_doorbell_message": {
"title": "set_doorbell_message is Deprecated",
"fix_flow": {
"step": {
"confirm": {
"title": "set_doorbell_message is Deprecated",
"description": "The `unifiprotect.set_doorbell_message` service is deprecated in favor of the new Doorbell Text entity added to each Doorbell device. It will be removed in v2023.3.0. Please update to use the [`text.set_value` service]({link})."
}
}
}
} }
}, },
"entity": { "entity": {

View File

@ -51,9 +51,16 @@
} }
}, },
"issues": { "issues": {
"deprecate_smart_sensor": { "deprecated_service_set_doorbell_message": {
"description": "The unified \"Detected Object\" sensor for smart detections is now deprecated. It has been replaced with individual smart detection binary sensors for each smart detection type. Please update any templates or automations accordingly.", "fix_flow": {
"title": "Smart Detection Sensor Deprecated" "step": {
"confirm": {
"description": "The `unifiprotect.set_doorbell_message` service is deprecated in favor of the new Doorbell Text entity added to each Doorbell device. It will be removed in v2023.3.0. Please update to use the [`text.set_value` service]({link}).",
"title": "set_doorbell_message is Deprecated"
}
}
},
"title": "set_doorbell_message is Deprecated"
}, },
"ea_setup_failed": { "ea_setup_failed": {
"description": "You are using v{version} of UniFi Protect which is an Early Access version. An unrecoverable error occurred while trying to load the integration. Please [downgrade to a stable version](https://www.home-assistant.io/integrations/unifiprotect#downgrading-unifi-protect) of UniFi Protect to continue using the integration.\n\nError: {error}", "description": "You are using v{version} of UniFi Protect which is an Early Access version. An unrecoverable error occurred while trying to load the integration. Please [downgrade to a stable version](https://www.home-assistant.io/integrations/unifiprotect#downgrading-unifi-protect) of UniFi Protect to continue using the integration.\n\nError: {error}",