Let sensehat ignore colour sensor warning

to close #958
This commit is contained in:
Dave Conway-Jones 2022-11-28 11:50:08 +00:00
parent 074ca44b5f
commit 2da42c9495
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-pi-sense-hat",
"version" : "0.1.3",
"version" : "0.1.4",
"description" : "A Node-RED node to interact with a Raspberry Pi Sense HAT",
"repository" : {
"type":"git",

View File

@ -107,7 +107,13 @@ module.exports = function(RED) {
// Any data on stderr means a bad thing has happened.
// Best to kill it and let it reconnect.
if (RED.settings.verbose) { RED.log.error("err: "+data+" :"); }
hat.kill('SIGKILL');
if (data.indexOf("WARNING") === 0) {
if (data.indexOf("sensor not present") !== -1) { return; }
else { RED.log.warn(data); }
}
else {
hat.kill('SIGKILL');
}
});
hat.stderr.on('error', function(err) { });
hat.stdin.on('error', function(err) { });