quentinms / homebridge-aranet4

An Homebridge plugin to get data from an Aranet4
Apache License 2.0
36 stars 1 forks source link

Make `peripheral` property private to avoid circular structure #12

Closed quentinms closed 2 years ago

quentinms commented 2 years ago

peripheral is an object that eventually contains itself. It's coming from the noble library so I don't have control over that.

This causes an issue when JSON.stringify() is called to save the accessory to disk.

Make the peripheral property private using ECMAScript private field (instead of typescript's private keyword), as it will exclude peripheral from JSON.stringify().

Fixes #11