From 46146d547e154c8ecce0eb6b59b52866cb7f5dfd Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Wed, 15 Jan 2025 07:07:25 -0700 Subject: [PATCH] cleanup a bit --- krha.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/krha.py b/krha.py index 6dde062..d97ff4f 100755 --- a/krha.py +++ b/krha.py @@ -27,18 +27,18 @@ class Runner(dbus.service.Object): command = query[3:] if not command: - return [("ha", "Home Assistant Commands", "home", 100, 1.0, + return [("ha", "Home Assistant Commands", "home", 100, 1.0, {'subtext': 'Type a command after "ha" to control Home Assistant'})] return [( - command, # data - f"Send to Home Assistant: {command}", # text - "home", # icon - 100, # type - 1.0, # relevance - {'subtext': 'Press Enter to send command'} # properties + command, + f"Send to Home Assistant: {command}", + "home", + 100, + 1.0, + {'subtext': 'Press Enter to send command'} )] - + @dbus.service.method(iface, out_signature='a(sss)') def Actions(self): return [("send", "Send to Home Assistant", "home")] @@ -49,12 +49,12 @@ class Runner(dbus.service.Object): if not self.api_key or not self.ha_url: print("Error: HA_API_KEY or HA_URL not configured") return - + headers = { "Authorization": f"Bearer {self.api_key}", "Content-Type": "application/json" } - + try: response = requests.post( f"{self.ha_url}/api/conversation/process",