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 node-switchbot import #928

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Fix node-switchbot import #928

merged 1 commit into from
Feb 7, 2024

Conversation

dnicolson
Copy link
Collaborator

♻️ Current situation

[SwitchBot] Was 'node-switchbot' found: false, Error: TypeError: SwitchBot is not a constructor
[SwitchBot] Curtain: Curtain wasn't able to establish BLE Connection, node-switchbot: false

💡 Proposed solution

Import the module correctly and stop unnecessarily importing noble. The latter was a workaround for what was fixed in OpenWonderLabs/node-switchbot#221.

There are still issues with node-switchbot due to (at least) the static declaration of getDeviceObject which causes this.noble to be undefined:
https://github.com/OpenWonderLabs/node-switchbot/blob/7a8e59ce395cda608b2e5b4dbd571dac47d9f1b1/src/switchbot.ts#L263

Do you have any ideas @donavanbecker? Have any of these 3.x.x releases worked for you with BLE?

@github-actions github-actions bot added enhancement New feature or request beta labels Feb 7, 2024
@donavanbecker donavanbecker merged commit 4725332 into OpenWonderLabs:beta-3.3.0 Feb 7, 2024
5 checks passed
@donavanbecker
Copy link
Collaborator

There are still issues with node-switchbot due to (at least) the static declaration of getDeviceObject which causes this.noble to be undefined: https://github.com/OpenWonderLabs/node-switchbot/blob/7a8e59ce395cda608b2e5b4dbd571dac47d9f1b1/src/switchbot.ts#L263

Do you have any ideas @donavanbecker? Have any of these 3.x.x releases worked for you with BLE?

I just worked through an issue that I found and have pushed to node-switchbot beta.

donavanbecker added a commit that referenced this pull request Feb 10, 2024
## [3.3.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v3.3.0) (2024-02-09)

### What's Changed
- Add config that allows you to set `cool` and `heat`: `min` & `max`
- Fix node-switchbot import [#928](#928), Thanks [@dnicolson](https://github.com/dnicolson)
- Code cleanup: Remove unnecessary await keyword [#929](#929), Thanks [@dnicolson](https://github.com/dnicolson)
- Code cleanup: Remove empty image tag [#930](#930), Thanks [@dnicolson](https://github.com/dnicolson)
- Housekeeping and updated dependencies.

**Full Changelog**: v3.2.0...v3.3.0
@donavanbecker donavanbecker mentioned this pull request Feb 10, 2024
donavanbecker added a commit that referenced this pull request Feb 10, 2024
## [3.3.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v3.3.0) (2024-02-09)

### What's Changed
- Add config that allows you to set `cool` and `heat`: `min` & `max`
- Fix node-switchbot import [#928](#928), Thanks [@dnicolson](https://github.com/dnicolson)
- Code cleanup: Remove unnecessary await keyword [#929](#929), Thanks [@dnicolson](https://github.com/dnicolson)
- Code cleanup: Remove empty image tag [#930](#930), Thanks [@dnicolson](https://github.com/dnicolson)
- Housekeeping and updated dependencies.

**Full Changelog**: v3.2.0...v3.3.0
banboobee pushed a commit to banboobee/homebridge-switchbot that referenced this pull request Mar 2, 2024
- Add config that allows you to set `cool` and `heat`: `min` & `max`
- Fix node-switchbot import [OpenWonderLabs#928](OpenWonderLabs#928), Thanks [@dnicolson](https://github.com/dnicolson)
- Code cleanup: Remove unnecessary await keyword [OpenWonderLabs#929](OpenWonderLabs#929), Thanks [@dnicolson](https://github.com/dnicolson)
- Code cleanup: Remove empty image tag [OpenWonderLabs#930](OpenWonderLabs#930), Thanks [@dnicolson](https://github.com/dnicolson)
- Housekeeping and updated dependencies.

**Full Changelog**: OpenWonderLabs/homebridge-switchbot@v3.2.0...v3.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants