From 7bd3aac7c5b53bab148c1b9eee1da91a3e57dbeb Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Sun, 7 May 2023 17:39:22 +0200 Subject: [PATCH] Fix error for no category --- pyhon/appliance.py | 4 +++- setup.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyhon/appliance.py b/pyhon/appliance.py index eab3a83..148d7d1 100644 --- a/pyhon/appliance.py +++ b/pyhon/appliance.py @@ -142,7 +142,9 @@ class HonAppliance: if last is None: continue parameters = command_history[last].get("command", {}).get("parameters", {}) - if command.categories: + if command.categories and ( + parameters.get("program") or parameters.get("category") + ): if parameters.get("program"): command.category = parameters.pop("program").split(".")[-1].lower() else: diff --git a/setup.py b/setup.py index 5c30924..068ef65 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.10.3", + version="0.10.4", author="Andre Basche", description="Control hOn devices with python", long_description=long_description,