Config flow for harmony (#32919)
* Config flow for harmony * Fixes unique ids when using XMPP Co-authored-by: Bram Kragten <mail@bramkragten.nl> * Find the unique id for the config flow * move shutdown to init * Add test for ssdp (still failing) * Fix ssdp test * Add harmony to MIGRATED_SERVICE_HANDLERS (this is a breaking change) * more cleanups * use unique id for the config file Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
5b4d2aed64
commit
d33a3ca90f
16 changed files with 656 additions and 82 deletions
15
homeassistant/components/harmony/util.py
Normal file
15
homeassistant/components/harmony/util.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
"""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
|
||||
|
||||
xmpp_unique_id = harmony.config.get("global", {}).get("timeStampHash")
|
||||
if not xmpp_unique_id:
|
||||
return None
|
||||
|
||||
return xmpp_unique_id.split(";")[-1]
|
Loading…
Add table
Add a link
Reference in a new issue