Skip to content

Commit

Permalink
Add new option to allow bypassing address validation in HT16K33 code …
Browse files Browse the repository at this point in the history
…to solve Issue #1834
  • Loading branch information
chrisl8 committed Oct 20, 2023
1 parent 094bf6c commit 809cee7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/led/ledcontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,14 @@ const Controllers = {
this.addresses = available.slice(0, state.devices);
}

this.addresses.forEach(address => {
if (!addresses.has(address)) {
throw new Error(`Invalid HT16K33 controller address: ${address}`);
}
addresses.delete(address);
});
if (!options.skipAddressValidation) {
this.addresses.forEach(address => {
if (!addresses.has(address)) {
throw new Error(`Invalid HT16K33 controller address: ${address}`);
}
addresses.delete(address);
});
}

this.rotation = options.rotation || 1;
// set a default rotation that works with AdaFruit 16x8 matrix if using 16 columns
Expand Down

0 comments on commit 809cee7

Please sign in to comment.