jherden84 / homebridge-mitsubishi-aircon-au-nz

Apache License 2.0
1 stars 2 forks source link

Possible typo in heatCoolService.ts #2

Open codewithzac opened 1 year ago

codewithzac commented 1 year ago

Describe Your Problem:

Found what might be a typo that's generating errors in the Homebridge logs. I don't have zones enabled, but the only reference to "lenth" in the code that I can find is in the test for whether zones are enabled - line 83 of heatCoolService.ts:

if (b.zones.lenth || b.zones.length >=2)

Should this be..?:

if (b.zones.length && b.zones.length >=2)

Logs:

[30/07/2023, 11:36:45 am] [homebridge-mitsubishi-aircon-au-nz] This plugin threw an error from the characteristic 'Active': Unhandled error thrown inside write handler for characteristic: Cannot read properties of undefined (reading 'lenth'). See https://homebridge.io/w/JtMGR for more info.

Plugin Config:

        {
            "user": "{{username}}",
            "password": "{{password}}",
            "dry": true,
            "zones": false,
            "zonetype": "none",
            "platform": "MitsubishiAUNZ"
        }

Environment:

chrisgagne commented 9 months ago

I can reproduce with this same version of the plugin and Homebridge 1.7.