comparison service/wifi/src/index.ts @ 1485:62be73d368df

fixes for streamedgraph build and a surprise with multi-value wifiBands Ignore-this: eea822327a0c66c4462ffd7c404079e5 darcs-hash:9341cc7bcc320e6ef7da3c79e9e3cd3c279bebb6
author drewp <drewp@bigasterisk.com>
date Thu, 09 Jan 2020 00:38:59 -0800
parents 4791c09f915f
children b267511ec4fc
comparison
equal deleted inserted replaced
1484:e188fd8351c0 1485:62be73d368df
4 4
5 import { LitElement, property, html, customElement } from "lit-element"; 5 import { LitElement, property, html, customElement } from "lit-element";
6 6
7 import { Literal, N3Store } from "n3"; 7 import { Literal, N3Store } from "n3";
8 import { NamedNode, DataFactory } from "n3"; 8 import { NamedNode, DataFactory } from "n3";
9 const { namedNode } = DataFactory; 9 const { namedNode, literal } = DataFactory;
10 10
11 import { VersionedGraph } from "streamed-graph"; 11 import { VersionedGraph } from "streamed-graph";
12 import { style } from "./style"; 12 import { style } from "./style";
13 import { labelFromUri, graphLiteral, graphUriValue } from "./graph_access"; 13 import { labelFromUri, graphLiteral, graphUriValue } from "./graph_access";
14 14
182 packetsPerSecDisplay: packetsPerSec + " P/s", 182 packetsPerSecDisplay: packetsPerSec + " P/s",
183 bytesPerSec: bytesPerSec, 183 bytesPerSec: bytesPerSec,
184 bytesPerSecDisplay: bytesPerSec + " B/s", 184 bytesPerSecDisplay: bytesPerSec + " B/s",
185 }; 185 };
186 186
187 const wifiBand = graphUriValue(store, devUri, room + "wifiBand"); 187 let wifiBand;
188 try {
189 wifiBand = graphUriValue(store, devUri, room + "wifiBand");
190 } catch (e) {
191 wifiBand = namedNode("multi"); // some have 5G and 2G?
192 }
193
188 const connectedToAp = graphUriValue(store, devUri, room + "connectedToAp"); 194 const connectedToAp = graphUriValue(store, devUri, room + "connectedToAp");
189 if (!this.showGroups || connectedToAp) { 195 if (!this.showGroups || connectedToAp) {
190 const key = this.showGroups 196 const key = this.showGroups
191 ? `${connectedToAp!.value}-${wifiBand!.value}` 197 ? `${connectedToAp!.value}-${wifiBand!.value}`
192 : "all"; 198 : "all";