Skip to content

Commit

Permalink
Add hidden network key to join networks
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Jun 3, 2024
1 parent 8370c78 commit dbc1c68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wifi-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const WifiDevice = base => class extends base {
* @param {Object} options See sendControlRequest(), same options are here.
* @return {ProtobufInteraction} - empty response
*/
async joinNewWifiNetwork({ ssid, security, password = null }, options) {
async joinNewWifiNetwork({ ssid, security, password = null, hidden }, options) {
let dataPayload;
if (password === null) {
dataPayload = {
Expand All @@ -82,6 +82,7 @@ const WifiDevice = base => class extends base {
dataPayload = {
ssid,
bssid: null,
hidden: hidden === true,
security: security ? WiFiSecurity.toProtobuf(security) : null,
credentials: {
type: 1, // CredentialsType.PASSWORD
Expand Down Expand Up @@ -187,7 +188,7 @@ const WifiDevice = base => class extends base {
* @param {Object} options See sendControlRequest(), same options are here.
* @return {ProtobufInteraction} - empty response
*/
async setWifiCredentials({ ssid, security, password = null }, options) {
async setWifiCredentials({ ssid, security, password = null, hidden }, options) {
let dataPayload;
if (password === null) {
dataPayload = {
Expand All @@ -199,6 +200,7 @@ const WifiDevice = base => class extends base {
dataPayload = {
ssid,
bssid: null,
hidden: hidden === true,
security : security ? WiFiSecurity.toProtobuf(security) : null,
credentials: {
type: 1, // CredentialsType.PASSWORD
Expand Down

0 comments on commit dbc1c68

Please sign in to comment.