Skip to content

Commit 3a34a9b

Browse files
committed
Merge branch 'release/1.0.15'
2 parents 7d88744 + 42e7815 commit 3a34a9b

File tree

2 files changed

+39
-45
lines changed

2 files changed

+39
-45
lines changed

.github/workflows/npm-ghr-publish.yml renamed to .github/workflows/npm-publish.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,3 @@ jobs:
3232
- run: npm publish
3333
env:
3434
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
35-
36-
publish-gpr:
37-
needs: build
38-
runs-on: ubuntu-latest
39-
permissions:
40-
contents: read
41-
packages: write
42-
steps:
43-
- uses: actions/checkout@v3
44-
- uses: actions/setup-node@v3
45-
with:
46-
node-version: 18
47-
registry-url: https://npm.pkg.github.com/
48-
- run: npm ci
49-
- run: npm publish
50-
env:
51-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

bin/meross-setup

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ program
3333
.version(version)
3434
.arguments('[options]')
3535
.option('-g, --gateway <gateway>', 'Set the gateway address', '10.10.10.1')
36+
.option('--nowifi', 'Do not configure WIFI')
3637
.option('--wifi-ssid <wifi-ssid>', 'WIFI AP name')
3738
.option('--wifi-pass <wifi-pass>', 'WIFI AP password')
3839
.option('--use-wifi-x', 'Use newer protocol on WifiX namespace with encrypted password')
@@ -52,31 +53,34 @@ if (!options.gateway) {
5253
process.exit(1)
5354
}
5455

55-
if (!options.wifiSsid) {
56-
console.error('WIFI ssid must be specified')
57-
process.exit(1)
58-
}
56+
if (!options.nowifi){
57+
if (!options.wifiSsid) {
58+
console.error('WIFI ssid must be specified')
59+
process.exit(1)
60+
}
5961

60-
if (!options.wifiPass) {
61-
console.error('WIFI password must be specified')
62-
process.exit(1)
63-
}
62+
if (!options.wifiPass) {
63+
console.error('WIFI password must be specified')
64+
process.exit(1)
65+
}
6466

65-
if (undefined !== options.wifiChannel && isNaN(options.wifiChannel)) {
66-
console.error('WIFI channel must be a number between 1-13')
67-
process.exit(1)
68-
}
67+
if (undefined !== options.wifiChannel && isNaN(options.wifiChannel)) {
68+
console.error('WIFI channel must be a number between 1-13')
69+
process.exit(1)
70+
}
6971

70-
if (undefined !== options.wifiEncryption && isNaN(options.wifiEncryption)) {
71-
console.error('WIFI encryption must be a number')
72-
process.exit(1)
73-
}
72+
if (undefined !== options.wifiEncryption && isNaN(options.wifiEncryption)) {
73+
console.error('WIFI encryption must be a number')
74+
process.exit(1)
75+
}
7476

75-
if (undefined !== options.wifiCipher && isNaN(options.wifiCipher)) {
76-
console.error('WIFI cipher must be a number')
77-
process.exit(1)
77+
if (undefined !== options.wifiCipher && isNaN(options.wifiCipher)) {
78+
console.error('WIFI cipher must be a number')
79+
process.exit(1)
80+
}
7881
}
7982

83+
8084
(async () => {
8185
const gateway = options.gateway
8286
const key = options.key
@@ -92,13 +96,20 @@ if (undefined !== options.wifiCipher && isNaN(options.wifiCipher)) {
9296

9397
await api.deviceInformation();
9498

95-
await api.configureWifiCredentials({
96-
ssid: options.wifiSsid,
97-
password: options.wifiPass,
98-
channel: options.wifiChannel,
99-
encryption: options.wifiEncryption,
100-
cipher: options.wifiCipher,
101-
bssid: options.wifiBssid,
102-
}, options.useWifiX)
103-
console.log(`Device will reboot...`)
99+
if (!options.nowifi) {
100+
await api.configureWifiCredentials({
101+
ssid: options.wifiSsid,
102+
password: options.wifiPass,
103+
channel: options.wifiChannel,
104+
encryption: options.wifiEncryption,
105+
cipher: options.wifiCipher,
106+
bssid: options.wifiBssid,
107+
}, options.useWifiX)
108+
console.log(`Device will reboot...`)
109+
}
110+
else{
111+
console.log(`Device has been configured.`)
112+
}
113+
114+
104115
})()

0 commit comments

Comments
 (0)