mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
fix button class and serial.list promise
This commit is contained in:
@@ -444,8 +444,14 @@ module.exports = function(RED) {
|
||||
}());
|
||||
|
||||
RED.httpAdmin.get("/serialports", RED.auth.needsPermission('serial.read'), function(req,res) {
|
||||
serialp.list(function (err, ports) {
|
||||
res.json(ports);
|
||||
});
|
||||
serialp.list().then(
|
||||
ports => {
|
||||
const a = ports.map(p => p.path);
|
||||
res.json(a);
|
||||
},
|
||||
err => {
|
||||
node.log('Error listing serial ports', err)
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user