hass-core/homeassistant/components/harmony/util.py
J. Nick Koston c9592c1447
Harmony config flow improvements (#33018)
* Harmony config flow improvements

* Address followup review comments from #32919

* pylint -- catching my naming error

* remove leftovers from refactor
2020-03-19 20:43:44 -05:00

12 lines
518 B
Python

"""The Logitech Harmony Hub integration utils."""
from aioharmony.harmonyapi import HarmonyAPI as HarmonyClient
def find_unique_id_for_remote(harmony: HarmonyClient):
"""Find the unique id for both websocket and xmpp clients."""
websocket_unique_id = harmony.hub_config.info.get("activeRemoteId")
if websocket_unique_id is not None:
return websocket_unique_id
# fallback to the xmpp unique id if websocket is not available
return harmony.config["global"]["timeStampHash"].split(";")[-1]