this repo has no description

better error handling for hue bridge responses

+6
+6
src/solux/controller.py
··· 170 170 171 171 if groups is None: 172 172 all_groups = bridge.get_group() 173 + if isinstance(all_groups, list): 174 + # hue api returns errors as a list, e.g. [{"error": {"description": "..."}}] 175 + errors = [g.get("error", {}).get("description") for g in all_groups if "error" in g] 176 + if errors: 177 + raise RuntimeError(f"hue bridge error: {'; '.join(errors)}") 178 + raise RuntimeError(f"unexpected response from bridge: {all_groups}") 173 179 groups = [ 174 180 info["name"] 175 181 for gid, info in all_groups.items()