Caught mixed usage, use .find() not .filter() to locate a single entry. Test exising methods now.
This commit is contained in:
parent
7e58ac40aa
commit
bcc29424da
|
@ -91,8 +91,8 @@ class Wifi {
|
|||
console.log(data)
|
||||
parsed = parseConfig(data)
|
||||
console.dir(parsed)
|
||||
current = parsed.filter(network => {
|
||||
return (network.ssid + '').toLowerCase() === (_ssid + '').toLowerCase()
|
||||
current = parsed.find(network => {
|
||||
return network.ssid === _ssid
|
||||
})
|
||||
console.log(current)
|
||||
if (typeof current !== 'undefined') {
|
||||
|
@ -102,7 +102,7 @@ class Wifi {
|
|||
}
|
||||
console.log(data)
|
||||
_entry = null
|
||||
this._writeConfigCb(null)
|
||||
setTimeout(this._writeConfigCb, 1)
|
||||
//fs.writeFile(filePath, data, 'utf8', this._writeConfigCb)
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue