kiwi-cam / homebridge-broadlink-rm

[This fork supports TV accessories] Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
304 stars 95 forks source link

Homebridge v2.0 Breaking Updates #722

Closed mitch7391 closed 3 months ago

mitch7391 commented 3 months ago

Describe the solution you'd like Hey @kiwi-cam I am not sure if you are aware but the next version of Homebridge (v2.0) comes with breaking changes for a lot of Homebridge plug-ins and it has been put on the developers to update their plug-ins.

For Plug-In Developers

I have tested this plug-in on the beta version and it will crash Homebridge.

Describe alternatives you've considered All users of this plug-in will have to remain on Homebridge v1.8.4.

Additional context image

Logs:

[27/07/2024, 4:06:19 pm] [Broadlink RM] Restarting Process...
[27/07/2024, 4:06:20 pm] [Broadlink RM] Launched child bridge with PID 21322
[27/07/2024, 4:06:23 pm] Registering platform 'homebridge-broadlink-rm-pro.BroadlinkRM'
[27/07/2024, 4:06:23 pm] [Broadlink RM] Loaded homebridge-broadlink-rm-pro v4.4.17 child bridge successfully
[27/07/2024, 4:06:23 pm] Loaded 0 cached accessories from cachedAccessories.0E61EA11E136.
[27/07/2024, 4:06:23 pm] [Broadlink RM] [INFO] Automatically discovering Broadlink RM devices.
[27/07/2024, 4:06:23 pm] [Broadlink RM] [INFO] Running Homebridge Broadlink RM Plugin version 4.4.17
HAP-NodeJS WARNING: The accessory 'X-mas Tree' has an invalid 'Name' characteristic ('X-mas Tree'). 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.
[27/07/2024, 4:06:23 pm] [Broadlink RM] X-mas Tree Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Blind Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Blind 1 Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Blind 2 Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Blind 3 Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Blind 4 Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Blind 5 Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Blind 6 Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Fairy Lights Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Spare Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Fan Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Fan Up Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Fan Down Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Fan Low Accessory Ready
[27/07/2024, 4:06:23 pm] [Broadlink RM] Fan High Accessory Ready
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Learn'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Scan Frequency'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'X-mas Tree'...
HAP-NodeJS WARNING: The accessory 'X-mas Tree' has an invalid 'Name' characteristic ('X-mas Tree'). 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.
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Blind'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Blind 1'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Blind 2'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Blind 3'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Blind 4'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Blind 5'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Blind 6'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Fairy Lights'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Spare'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Fan'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Fan Up'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Fan Down'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Fan Low'...
[27/07/2024, 4:06:23 pm] Initializing platform accessory 'Fan High'...
[27/07/2024, 4:06:23 pm] Homebridge v2.0.0-beta.8 (HAP v1.1.0) (Broadlink RM) is running on port 37302.

/usr/local/lib/node_modules/homebridge-broadlink-rm-pro/helpers/serviceManager.js:27
    this.getCharacteristic(characteristic).getValue();
                                           ^
TypeError: this.getCharacteristic(...).getValue is not a function
    at ServiceManager.refreshCharacteristicUI (/usr/local/lib/node_modules/homebridge-broadlink-rm-pro/helpers/serviceManager.js:27:44)
    at Timeout._onTimeout (/usr/local/lib/node_modules/homebridge-broadlink-rm-pro/base/accessory.js:209:43)
    at listOnTimeout (node:internal/timers:581:17)
    at processTimers (node:internal/timers:519:7)
[27/07/2024, 4:06:23 pm] [Broadlink RM] Child bridge process ended
[27/07/2024, 4:06:23 pm] [Broadlink RM] Process Ended. Code: 1, Signal: null
kiwi-cam commented 3 months ago

The latest Beta should resolve at least one of the issues. Unfortunately it looks like fakegato-history isn't compatible yet which will break the plugin.

mitch7391 commented 3 months ago

@kiwi-cam I should have added some logs with my issue, I have updated my issue with them just in case but looks like your new beta version is working with Homebridge v2 :)

kiwi-cam commented 3 months ago

I've notice one issue with the compatibility changes. Previously, using deprecated getValue() would trigger a refresh of the data too. This was used for temperature and humidity sensors to trigger a data update at set intervals. Using "value" doesn't trigger the get method to refresh the data so updates are sporadic - very noticeable in fakegato.

I haven't found a simple workaround for this yet - it might require a small rework of the monitorTemperature code.

kiwi-cam commented 3 months ago

4.4.18 is now released and includes the required changes