Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit f4911ac

Browse files
author
Ihor Savchenko
committed
fix channel and band types
1 parent 828a551 commit f4911ac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
// defaults
1111
const AP_SSID = process.env.AP_SSID || `WiFi Repeater`;
1212
const AP_PASSWORD = process.env.AP_PASSWORD || '';
13-
const AP_CHANNEL = process.env.AP_CHANNEL || 1;
13+
const AP_CHANNEL = Number(process.env.AP_CHANNEL) || 1;
1414
const AP_BAND = process.env.AP_PASSWORD || 'bg';
1515
const WIFI_SSID = process.env.WIFI_SSID;
1616
const WIFI_PASSWORD = process.env.WIFI_PASSWORD;

src/nm.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export interface WirelessNetwork {
2424
iface: string;
2525
ssid: string;
2626
password?: string;
27-
channel: number;
28-
band: string;
27+
channel?: number;
28+
band?: string;
2929
}
3030

3131
const nm: string = 'org.freedesktop.NetworkManager';
@@ -49,7 +49,7 @@ export const createAccessPoint = async (device: WirelessNetwork): Promise<any> =
4949
['802-11-wireless', [
5050
['ssid', ['ay', stringToArrayOfBytes(device.ssid)]],
5151
['mode', ['s', 'ap']],
52-
['channel', ['u'], device.channel],
52+
['channel', ['u', device.channel]],
5353
['band', ['s', device.band]],
5454
]],
5555
['ipv4', [

0 commit comments

Comments
 (0)