comment var test 1
This commit is contained in:
1 parent
77de5f007e
commit
4dd9a73cbb
2 files changed
+8
-5
No files matched your search
@@ -6,16 +6,16 @@ debug_output = False
|
||||
bind_ip = "0.0.0.0"
|
||||
api_port = 5000
|
||||
redis_port = 6379
|
||||
enable_redis = False
|
||||
enable_redis = True
|
||||
|
||||
# --- This will store friendly names for MAC addresses -----------------
|
||||
comment_lookup = [
|
||||
{
|
||||
"mac": "A4:C1:38:00:11:10",
|
||||
"comment": "Living Room"
|
||||
"mac": "A4:C1:38:11:F4:2A",
|
||||
"comment": "Sensor 0"
|
||||
},
|
||||
{
|
||||
"mac": "A4:C1:38:00:11:11",
|
||||
"comment": "Main Bedroom"
|
||||
"mac": "A4:C1:38:D7:8D:26",
|
||||
"comment": "Sensor 1"
|
||||
}
|
||||
]
|
||||
@@ -81,6 +81,9 @@ class Sensor:
|
||||
self.first_seen = ts
|
||||
self.last_seen = ts
|
||||
self.comment = self.name
|
||||
for sensor in comment_lookup:
|
||||
if sensor['mac'] == self.name:
|
||||
self.comment = sensor['comment']
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# Core API
|
||||
|
||||
Reference in new issue
Block a user