asednev / homebridge-plugin-govee

Govee H-series Thermometer Hygrometer plugin for Homebrige.
Apache License 2.0
53 stars 9 forks source link

1.1.5 has breaking change - fails when no ignored devices defined #59

Closed ikura closed 2 years ago

ikura commented 2 years ago

Describe The Bug: Upgrading to 1.1.5 broke the plugin, causing a TypeError

To Reproduce: Install 1.1.5 Configure with no ignored devices.

Expected behavior: Expected the plugin to continue to work correctly,

Logs:

TypeError: Cannot read properties of undefined (reading 'includes')
    at GoveeHomebridgePlatform.goveeDiscoveredReading (/usr/local/lib/node_modules/homebridge-plugin-govee/dist/platform.js:76:32)

Plugin Config:

{
            "name": "Govee",
            "batteryThreshold": 25,
            "debug": false,
            "humidityOffset": 0,
            "platform": "GoveeHomebridgePlugin"
        },

Environment:

ikura commented 2 years ago

I found a workaround to just add random text to the 'ignored devices' part of the configuration

MrFly72 commented 2 years ago

I will look at it on Monday. Sorry for that, did not test it with no entries. You workaround seems reasonable to have at least something in the list. As it is a simple string match that was added, it will just not find the string and add all other devices.

MrFly72 commented 2 years ago

Already have a tested a fix (developed only my iPad) 😀 Will put it into code on Monday. List will now be checked if empty and check for ignored devices skipped.

MrFly72 commented 2 years ago

Added a pull request for the project owner. Hope i did it right, as GitHub is not really my "home" ;-)

asednev commented 2 years ago

@MrFly72 Thank you for a quick turn around on the fix.

I published version 1.1.6 that fixes the issue. Sorry for the delay, it took me some time to fix my setup to test everything before publishing.