def get_roon_host(): host = self.config_entry.data.get(CONF_HOST) port = self.config_entry.data.get(CONF_PORT) if host: _LOGGER.debug("static roon core host=%s port=%s", host, port) return (host, port) discover = RoonDiscovery(core_id) server = discover.first() discover.stop() _LOGGER.debug("dynamic roon core core_id=%s server=%s", core_id, server) return (server[0], server[1])
"display_name": "Python library for Roon", "display_version": "1.0.0", "publisher": "gregd", "email": "*****@*****.**", } try: core_id = open("my_core_id_file").read() token = open("my_token_file").read() except OSError: print("Please authorise first using discovery.py") exit() discover = RoonDiscovery(core_id) server = discover.first() discover.stop() roonapi = RoonApi(appinfo, token, server[0], server[1], True) # get all zones (as dict) zones = roonapi.zones outputs = roonapi.outputs for (k, v) in outputs.items(): zone_id = v["zone_id"] output_id = k display_name = v["display_name"] is_group_main = roonapi.is_group_main(output_id) is_grouped = roonapi.is_grouped(output_id) grouped_zone_names = roonapi.grouped_zone_names(output_id) print(