Home Assistant Unofficial Reference 2024.12.1
utils.py
Go to the documentation of this file.
1 """Utility functions for the Bluesound component."""
2 
3 from homeassistant.helpers.device_registry import format_mac
4 
5 
6 def format_unique_id(mac: str, port: int) -> str:
7  """Generate a unique ID based on the MAC address and port number."""
8  return f"{format_mac(mac)}-{port}"
str format_unique_id(str mac, int port)
Definition: utils.py:6