Fix a bug in device.py around the type of keywords, add logging and
[python_utils.git] / smart_home / device.py
index 9675b7c66ed26527d6c389854a8cf488a012f530..06187d7a6578e2eaedb5d86e6173977d62b6288d 100644 (file)
@@ -8,17 +8,17 @@ import arper
 
 class Device(object):
     def __init__(
-            self,
-            name: str,
-            mac: str,
-            keywords: Optional[List[str]],
+        self,
+        name: str,
+        mac: str,
+        keywords: Optional[str] = "",
     ):
         self.name = name
         self.mac = mac
         self.keywords = keywords
         self.arper = arper.Arper()
         if keywords is not None:
-            self.kws = keywords.split()
+            self.kws: List[str] = keywords.split(' ')
         else:
             self.kws = []