From 05a26ae305adfc47f38b8534ec8f35640df3955e Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Fri, 29 Oct 2021 11:26:45 -0700 Subject: Fix Arper, make IP address a property of device --- smart_home/device.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'smart_home/device.py') 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 -- cgit v1.3