Cleanup unifiprotect discovery name (#64389)

This commit is contained in:
J. Nick Koston 2022-01-18 12:38:16 -10:00 committed by GitHub
parent 9e33a3014c
commit 8aec26d105
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 81 additions and 8 deletions

View file

@ -19,6 +19,7 @@ from homeassistant.helpers.service import async_extract_referenced_entity_ids
from .const import ATTR_MESSAGE, DOMAIN
from .data import ProtectData
from .utils import _async_unifi_mac_from_hass
SERVICE_ADD_DOORBELL_TEXT = "add_doorbell_text"
SERVICE_REMOVE_DOORBELL_TEXT = "remove_doorbell_text"
@ -48,12 +49,6 @@ def _async_all_ufp_instances(hass: HomeAssistant) -> list[ProtectApiClient]:
]
@callback
def _async_unifi_mac_from_hass(mac: str) -> str:
# MAC addresses in UFP are always caps
return mac.replace(":", "").upper()
@callback
def _async_get_macs_for_device(device_entry: dr.DeviceEntry) -> list[str]:
return [