Add entity translations to Balboa (#104543)

This commit is contained in:
Joost Lekkerkerker 2023-11-26 13:07:21 +01:00 committed by GitHub
parent e3599bc26f
commit 2e1c722303
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 17 deletions

View file

@ -15,12 +15,11 @@ class BalboaEntity(Entity):
_attr_should_poll = False
_attr_has_entity_name = True
def __init__(self, client: SpaClient, name: str | None = None) -> None:
def __init__(self, client: SpaClient, key: str) -> None:
"""Initialize the control."""
mac = client.mac_address
model = client.model
self._attr_unique_id = f'{model}-{name}-{mac.replace(":","")[-6:]}'
self._attr_name = name
self._attr_unique_id = f'{model}-{key}-{mac.replace(":","")[-6:]}'
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, mac)},
name=model,