lukasroegner / homebridge-dyson-pure-cool

Plugin for using the Dyson Pure Cool fans in homebridge.
MIT License
296 stars 51 forks source link

v2.7.12 on Homebridge v2.0.0 beta 13 - TypeError in switchAccessory.getServiceByUUIDAndSubType #346

Open jakepez opened 2 months ago

jakepez commented 2 months ago

Homebridge v2.0.0. beta 13 Plugin: v2.7.12

Runs without error on Homebridge v1.8.4

Crashes with (full logs attached):

[8/31/2024, 12:39:44 PM] [homebridge-dyson-pure-cool] Device with serial number PE7-US-KNA3301A: product type 455
[8/31/2024, 12:39:44 PM] Homebridge v2.0.0-beta.13 (HAP v1.1.1-beta.2) (homebridge-dyson-pure-cool) is running on port 34815.
/homebridge/node_modules/homebridge-dyson-pure-cool/src/dyson-pure-cool-device.js:319
        nightModeSwitchService = switchAccessory.getServiceByUUIDAndSubType(Service.Switch, 'NightMode');
                                                 ^
TypeError: switchAccessory.getServiceByUUIDAndSubType is not a function
    at new DysonPureCoolDevice (/homebridge/node_modules/homebridge-dyson-pure-cool/src/dyson-pure-cool-device.js:319:50)
    at HomebridgeAPI.<anonymous> (/homebridge/node_modules/homebridge-dyson-pure-cool/src/dyson-pure-cool-platform.js:97:35)
    at HomebridgeAPI.emit (node:events:519:28)
    at HomebridgeAPI.signalFinished (file:///homebridge/node_modules/homebridge/src/api.ts:254:10)
    at ChildBridgeFork.startBridge (file:///homebridge/node_modules/homebridge/src/childBridgeFork.ts:196:14)
[8/31/2024, 12:39:44 PM] [homebridge-dyson-pure-cool] Child bridge ended (code 1, signal null). The child bridge ended unexpectedly, which is normally due to the plugin not catching its errors properly. Please report this to the plugin developer by clicking on the 'Report An Issue' option in the plugin menu dropdown from the Homebridge UI. If there are related logs shown above, please include them in your report.

homebridge-dyson-pure-cool.log.txt

fubu2k commented 2 months ago

same for me, even with Homebridge v2.0.0. beta 20

speedingcheetah commented 1 month ago

Same. Plugin just crashes over and over. Fails to work on HB 2.0. Requires update/code change to meet HB 2.0 standards. This is the only plugin that fails to work for me.

lukasroegner commented 1 month ago

Thanks to the PR from @bwp91 homebridge v2 should be supported now, please try the latest version from NPM.

speedingcheetah commented 1 month ago

Thanks to the PR from @bwp91 homebridge v2 should be supported now, please try the latest version from NPM.

Updated plugin and HB to v2.0.0 beta 22 and UI to v4.61.1 beta.0 Plugin loading fine and working. Thank YOU!

The only thing is that it spams in the logs

" has an invalid 'Name' characteristic ('homebridge-dyson-pure-cool'). Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis. This may prevent the accessory from being added in the Home App or cause unresponsiveness." Which, seems all plugins that are named with "-" etc are throwing. Or any of its accessories that do not follow the new naming requirements.