Mercurial > code > home > repos > homeauto
comparison service/wifi/scrape.py @ 1444:4afb1830bb5e
use rx version 3.x
Ignore-this: 4232f8e780d35a8d0642e86521eb2801
darcs-hash:747608892b607f78260f4772a4ff2b24c7392f73
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Tue, 24 Sep 2019 14:04:02 -0700 |
parents | 140d8d419cf0 |
children |
comparison
equal
deleted
inserted
replaced
1443:99540f1a11f7 | 1444:4afb1830bb5e |
---|---|
62 triples = set() | 62 triples = set() |
63 uri = macUri(row['mac'].lower()) | 63 uri = macUri(row['mac'].lower()) |
64 | 64 |
65 if row['contype'] in ['2.4G', '5G']: | 65 if row['contype'] in ['2.4G', '5G']: |
66 orbi = macUri(row['conn_orbi_mac']) | 66 orbi = macUri(row['conn_orbi_mac']) |
67 triples.add((orbi, ROOM['wifiBand'], | 67 ct = ROOM['wifiBand/%s' % row['contype']] |
68 ROOM['wifiBand/%s' % row['contype']])) | |
69 triples.add((uri, ROOM['connectedToAp'], orbi)) | 68 triples.add((uri, ROOM['connectedToAp'], orbi)) |
69 triples.add((uri, ROOM['wifiBand'], ct)) | |
70 triples.add((orbi, RDF.type, ROOM['AccessPoint'])) | 70 triples.add((orbi, RDF.type, ROOM['AccessPoint'])) |
71 triples.add((orbi, ROOM['wifiBand'], ct)) | |
71 triples.add((orbi, ROOM['macAddress'], | 72 triples.add((orbi, ROOM['macAddress'], |
72 Literal(row['conn_orbi_mac'].lower()))) | 73 Literal(row['conn_orbi_mac'].lower()))) |
73 triples.add((orbi, RDFS.label, Literal(row['conn_orbi_name']))) | 74 triples.add((orbi, RDFS.label, Literal(row['conn_orbi_name']))) |
74 elif row['contype'] == 'wireless': | 75 elif row['contype'] == 'wireless': |
75 pass | 76 pass |