Open
Conversation
…ith multiple boards. When working with multiple boards, Johnny Five can get confused which board to use. By using the optional `board` parameter and passing the board variable used to initialize Oled, we can fix that.
When building the Johnny Fives types, we get the error: ``` node_modules/@types/johnny-five/index.d.ts:663:21 - error TS1005: ',' expected. 663 song: [frequency: string | null, duration: number][]; ``` Upgrading to Typescript 4.x solves this issue.
When building with Typescript 4 we get the following build error for all private properties and functions: ``` oled.ts - error TS4094: Property '[all private variables and functions]' of exported class expression may not be private or protected. ``` If I read this issue correctly, the `private` definition is not really supported, so I'm commenting it out for now.
We need the build output in order to reference this branch directly in a package.json file. If the PR is merged and released, these files can be removed again.
Since the most current version of serialport is >10 and the serialport dependency seems to be unused in this repo, let's remove it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When working with multiple boards in Johnny Five it's necessary to specify the board as an option. (http://johnny-five.io/api/pin/)
By changing
this.rstPin = new this.five.Pin(this.RESETPIN)tothis.rstPin = new this.five.Pin({pin: this.RESETPIN, board: this.board})we can successfully work in environments where the board definition would otherwise be ambiguous.After this relatively simple change, I encountered a number of (unrelated) problems with building the Typescript.
On the first try I got the error:
Upgrading to Typescript 4.x solves this issue.
On the second try I got:
If I read this issue microsoft/TypeScript#17293 correctly, the
privatedefinition is not really supported, so I'm commenting it out for now.