Skip to content

Commit

Permalink
feat(ui): add channel 3 to background rsi chart
Browse files Browse the repository at this point in the history
Fixes #3669
  • Loading branch information
robertsLando committed Apr 19, 2024
1 parent c10d532 commit b34856d
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 36 deletions.
1 change: 1 addition & 0 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ export interface BackgroundRSSIPoint {
channel0: BackgroundRSSIValue
channel1: BackgroundRSSIValue
channel2?: BackgroundRSSIValue
channel3?: BackgroundRSSIValue
timestamp: number
}

Expand Down
76 changes: 45 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 23 additions & 5 deletions src/components/custom/BgRssiChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ export default {
const channel0 = [[], []]
const channel1 = [[], []]
const channel2 = [[], []]
const channel3 = [[], []]
if (this.node.bgRSSIPoints && this.node.bgRSSIPoints.length > 0) {
this.node.bgRSSIPoints.forEach((point) => {
timestamps.push(point.timestamp / 1000)
Expand All @@ -179,14 +181,30 @@ export default {
this.checkRssiError(point.channel1.current),
)
channel1[1].push(point.channel1.average)
channel2[0].push(
this.checkRssiError(point.channel2?.current),
)
channel2[1].push(point.channel2?.average)
if (point.channel2) {
channel2[0].push(
this.checkRssiError(point.channel2.current),
)
channel2[1].push(point.channel2.average)
}
if (point.channel3) {
channel3[0].push(
this.checkRssiError(point.channel3.current),
)
channel3[1].push(point.channel3.average)
}
})
}
return [timestamps, ...channel0, ...channel1, ...channel2]
return [
timestamps,
...channel0,
...channel1,
...channel2,
...channel3,
]
},
},
watch: {
Expand Down

0 comments on commit b34856d

Please sign in to comment.