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"
|
bind_ip = "0.0.0.0"
|
||||||
api_port = 5000
|
api_port = 5000
|
||||||
redis_port = 6379
|
redis_port = 6379
|
||||||
enable_redis = False
|
enable_redis = True
|
||||||
|
|
||||||
# --- This will store friendly names for MAC addresses -----------------
|
# --- This will store friendly names for MAC addresses -----------------
|
||||||
comment_lookup = [
|
comment_lookup = [
|
||||||
{
|
{
|
||||||
"mac": "A4:C1:38:00:11:10",
|
"mac": "A4:C1:38:11:F4:2A",
|
||||||
"comment": "Living Room"
|
"comment": "Sensor 0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mac": "A4:C1:38:00:11:11",
|
"mac": "A4:C1:38:D7:8D:26",
|
||||||
"comment": "Main Bedroom"
|
"comment": "Sensor 1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -81,6 +81,9 @@ class Sensor:
|
|||||||
self.first_seen = ts
|
self.first_seen = ts
|
||||||
self.last_seen = ts
|
self.last_seen = ts
|
||||||
self.comment = self.name
|
self.comment = self.name
|
||||||
|
for sensor in comment_lookup:
|
||||||
|
if sensor['mac'] == self.name:
|
||||||
|
self.comment = sensor['comment']
|
||||||
|
|
||||||
# ----------------------------------------------------------------------- #
|
# ----------------------------------------------------------------------- #
|
||||||
# Core API
|
# Core API
|
||||||
|
|||||||
Reference in new issue
Block a user