Remove default name prefix of HomePods from Suggested Area in Apple TV integration (#109489)
This commit is contained in:
parent
8a9478b714
commit
2c91b31233
1 changed files with 7 additions and 2 deletions
|
@ -40,7 +40,8 @@ from .const import CONF_CREDENTIALS, CONF_IDENTIFIERS, CONF_START_OFF, DOMAIN
|
|||
|
||||
_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_UPPER_LIMIT = 300 # Five minutes
|
||||
|
@ -358,7 +359,11 @@ class AppleTVManager(DeviceListener):
|
|||
ATTR_MANUFACTURER: "Apple",
|
||||
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:
|
||||
dev_info = self.atv.device_info
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue