MCPcopy Create free account
hub / github.com/bytespider/Meross / printWifiListTable

Function printWifiListTable

packages/cli/src/cli.ts:116–136  ·  view source on GitHub ↗
(
  wifiList: WifiAccessPoint[]
)

Source from the content-addressed store, hash-verified

114 * @param {object[]} wifiList
115 */
116export async function printWifiListTable(
117 wifiList: WifiAccessPoint[]
118): Promise<void> {
119 const rows = [['WIFI', 'Signal strength']];
120
121 for (const { ssid, bssid, channel, encryption, cipher, signal } of wifiList) {
122 rows.push([
123 `${
124 ssid ? ssid : '<hidden>'
125 }\n^B${bssid}^ ^+^YCh:^ ${channel} ^+^YEncryption:^ ${encryption} ^+^YCipher:^ ${cipher}`,
126 bar(signal / 100, 20),
127 ]);
128 }
129
130 const thisTableOptions = tableOptions;
131 thisTableOptions.firstColumnVoidAttr = { contentWidth: 55 };
132 thisTableOptions.firstColumnTextAttr = { color: 'cyan' };
133 thisTableOptions.firstRowTextAttr = { color: 'yellow' };
134
135 terminal.table(rows, thisTableOptions);
136}

Callers 1

meross-info.tsFile · 0.85

Calls 1

barFunction · 0.85

Tested by

no test coverage detected