mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Remove default name prefix of HomePods from Suggested Area in Apple TV integration (#109489)
This commit is contained in:
parent
8a9478b714
commit
2c91b31233
@ -40,7 +40,8 @@ from .const import CONF_CREDENTIALS, CONF_IDENTIFIERS, CONF_START_OFF, DOMAIN
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_NAME = "Apple TV"
|
DEFAULT_NAME_TV = "Apple TV"
|
||||||
|
DEFAULT_NAME_HP = "HomePod"
|
||||||
|
|
||||||
BACKOFF_TIME_LOWER_LIMIT = 15 # seconds
|
BACKOFF_TIME_LOWER_LIMIT = 15 # seconds
|
||||||
BACKOFF_TIME_UPPER_LIMIT = 300 # Five minutes
|
BACKOFF_TIME_UPPER_LIMIT = 300 # Five minutes
|
||||||
@ -358,7 +359,11 @@ class AppleTVManager(DeviceListener):
|
|||||||
ATTR_MANUFACTURER: "Apple",
|
ATTR_MANUFACTURER: "Apple",
|
||||||
ATTR_NAME: self.config_entry.data[CONF_NAME],
|
ATTR_NAME: self.config_entry.data[CONF_NAME],
|
||||||
}
|
}
|
||||||
attrs[ATTR_SUGGESTED_AREA] = attrs[ATTR_NAME].removesuffix(f" {DEFAULT_NAME}")
|
attrs[ATTR_SUGGESTED_AREA] = (
|
||||||
|
attrs[ATTR_NAME]
|
||||||
|
.removesuffix(f" {DEFAULT_NAME_TV}")
|
||||||
|
.removesuffix(f" {DEFAULT_NAME_HP}")
|
||||||
|
)
|
||||||
|
|
||||||
if self.atv:
|
if self.atv:
|
||||||
dev_info = self.atv.device_info
|
dev_info = self.atv.device_info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user