Skip to content

Commit

Permalink
Update P1Platform.js
Browse files Browse the repository at this point in the history
Bug fix: TypeError when telegram structure changes (e.g. when removing a meter), see #78.
  • Loading branch information
ebaauw committed Jul 7, 2023
1 parent 244048d commit 363d37e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/P1Platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,16 @@ class P1Platform extends homebridgeLib.Platform {
} else {
this.vdebug('data: %j', data)
this.electricity.check(data.electricity)
if (this.electricityBack != null) {
if (this.electricityBack != null && data.electricityBack != null) {
this.electricityBack.check(data.electricityBack)
}
if (this.electricityCapacity != null) {
this.electricityCapacity.check(data.electricity)
}
if (this.gas != null) {
if (this.gas != null && data.gas != null) {
this.gas.check(data.gas)
}
if (this.water != null) {
if (this.water != null && data.water != null) {
this.water.check(data.water)
}
}
Expand Down

0 comments on commit 363d37e

Please sign in to comment.