summaryrefslogtreecommitdiff
path: root/smart_home/device.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2021-10-29 11:26:45 -0700
committerScott Gasch <[email protected]>2021-10-29 11:26:45 -0700
commit05a26ae305adfc47f38b8534ec8f35640df3955e (patch)
treeb95bab2665df998e6bf256906a167dba7736d8b6 /smart_home/device.py
parent29ee1f98654a689e9cab76b0c7c68428faa43a8c (diff)
Fix Arper, make IP address a property of device
Diffstat (limited to 'smart_home/device.py')
-rw-r--r--smart_home/device.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/smart_home/device.py b/smart_home/device.py
index 0953b8d..04b0bfe 100644
--- a/smart_home/device.py
+++ b/smart_home/device.py
@@ -3,6 +3,8 @@
import re
from typing import List, Optional
+import arper
+
class Device(object):
def __init__(
@@ -14,6 +16,7 @@ class Device(object):
self.name = name
self.mac = mac
self.keywords = keywords
+ self.arper = arper.Arper()
if keywords is not None:
self.kws = keywords.split()
else:
@@ -26,7 +29,7 @@ class Device(object):
return self.mac
def get_ip(self) -> str:
- pass
+ return self.arper.get_ip_by_mac(self.mac)
def get_keywords(self) -> Optional[List[str]]:
return self.kws