1 """The Logitech Harmony Hub integration utils."""
3 import aioharmony.exceptions
as harmony_exceptions
4 from aioharmony.harmonyapi
import HarmonyAPI
10 """Find the unique id for both websocket and xmpp clients."""
11 if harmony.hub_id
is not None:
12 return str(harmony.hub_id)
15 return harmony.config[
"global"][
"timeStampHash"].split(
";")[-1]
19 """Find the best name from config or fallback to the remote."""
23 if CONF_NAME
not in data
or data[CONF_NAME]
is None or data[CONF_NAME] ==
"":
26 return data[CONF_NAME]
30 """Connect to a harmony hub and fetch info."""
31 harmony = HarmonyAPI(ip_address=ip_address)
34 if not await harmony.connect():
37 except harmony_exceptions.TimeOut:
def find_unique_id_for_remote(HarmonyAPI harmony)
def find_best_name_for_remote(dict data, HarmonyAPI harmony)
HarmonyAPI|None get_harmony_client_if_available(str ip_address)