fix button class and serial.list promise

This commit is contained in:
Dave Conway-Jones
2019-11-13 18:43:43 +00:00
parent 3ed1e72481
commit 0bef668028
3 changed files with 12 additions and 9 deletions

View File

@@ -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)
}
)
});
}