summaryrefslogtreecommitdiff
path: root/presence.py
diff options
context:
space:
mode:
Diffstat (limited to 'presence.py')
-rwxr-xr-xpresence.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/presence.py b/presence.py
index 947ff08..e5bc64f 100755
--- a/presence.py
+++ b/presence.py
@@ -83,7 +83,10 @@ class PresenceDetection(object):
def update(self) -> None:
from exec_utils import cmd
- persisted_macs = config.config['presence_macs_file']
+ try:
+ persisted_macs = config.config['presence_macs_file']
+ except KeyError:
+ persisted_macs = '/home/scott/cron/persisted_mac_addresses.txt'
self.read_persisted_macs_file(persisted_macs, Location.HOUSE)
raw = cmd(
"ssh [email protected] 'cat /home/scott/cron/persisted_mac_addresses.txt'"
@@ -166,7 +169,7 @@ class PresenceDetection(object):
location = dict_utils.key_with_min_value(tiebreaks)
v = votes.get(location, 0)
votes[location] = v + credit
- logger.debug('{name}: {location} gets {credit} votes.')
+ logger.debug(f'{name}: {location} gets {credit} votes.')
credit = int(
credit * 0.667
) # Note: list most important devices first