* Add config flow to bluesound * update init * abort flow if connection is not possible * add to codeowners * update unique id * add async_unload_entry * add import flow * add device_info * add zeroconf * fix errors * formatting * use bluos specific zeroconf service type * implement requested changes * implement requested changes * fix test; add more tests * use AsyncMock assert functions * fix potential naming collision * move setup_services back to media_player.py * implement requested changes * add port to zeroconf flow * Fix comments --------- Co-authored-by: Joostlek <joostlek@outlook.com>
8 lines
279 B
Python
8 lines
279 B
Python
"""Utility functions for the Bluesound component."""
|
|
|
|
from homeassistant.helpers.device_registry import format_mac
|
|
|
|
|
|
def format_unique_id(mac: str, port: int) -> str:
|
|
"""Generate a unique ID based on the MAC address and port number."""
|
|
return f"{format_mac(mac)}-{port}"
|