Move attribution to standalone attribute [h-l] (#80516)

This commit is contained in:
epenet 2022-10-18 11:18:22 +02:00 committed by GitHub
parent 9ff077e225
commit 5d207f77ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 27 additions and 34 deletions

View file

@ -16,7 +16,7 @@ from pyicloud.services.findmyiphone import AppleDevice
from homeassistant.components.zone import async_active_zone
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ATTRIBUTION, CONF_USERNAME
from homeassistant.const import CONF_USERNAME
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.dispatcher import dispatcher_send
@ -48,8 +48,6 @@ from .const import (
DOMAIN,
)
ATTRIBUTION = "Data provided by Apple iCloud"
# entity attributes
ATTR_ACCOUNT_FETCH_INTERVAL = "account_fetch_interval"
ATTR_BATTERY = "battery"
@ -368,6 +366,8 @@ class IcloudAccount:
class IcloudDevice:
"""Representation of a iCloud device."""
_attr_attribution = "Data provided by Apple iCloud"
def __init__(self, account: IcloudAccount, device: AppleDevice, status) -> None:
"""Initialize the iCloud device."""
self._account = account
@ -385,7 +385,6 @@ class IcloudDevice:
self._location = None
self._attrs = {
ATTR_ATTRIBUTION: ATTRIBUTION,
ATTR_ACCOUNT_FETCH_INTERVAL: self._account.fetch_interval,
ATTR_DEVICE_NAME: self._device_model,
ATTR_DEVICE_STATUS: None,