Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash for BP-series devices #336

Merged
merged 1 commit into from
May 12, 2024

Conversation

gisselin
Copy link
Contributor

This pull request introduces crucial updates to the Homebridge-Dyson-Pure-Cool plugin to prevent crashes with Dyson devices that lack oscillation features, particularly the BP-series. The modifications add checks to ensure that oscillation controls are only invoked for devices that support this functionality and fixes crashes reported in #333 and #328.

Key Changes:

Conditional Oscillation Control: Modified the DysonPureCoolDevice logic to conditionally update the SwingMode characteristic based on the device's oscillation capability. This is done by wrapping oscillation control updates within an if (device.info.hasOscillation) check to prevent errors with non-oscillating devices.

Updated Device Information: Added a new attribute hasOscillation: false to the BP-series models in the knownProducts dictionary within productTypeInfo.js. This ensures that the system recognizes these devices as non-oscillating. It also assumes that most devices do have oscillation enabled, which is the case as of May '24.

Configurable Oscillation Behavior: Adjusted the handling of the enableOscillationWhenActivating configuration option to check for the hasOscillation flag before setting oscillation to 'ON'.

@lukasroegner lukasroegner merged commit 9430e19 into lukasroegner:master May 12, 2024
@lukasroegner
Copy link
Owner

@gisselin Thank you! New version 2.7.10 is published on npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants