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

Bug: Max retry functionality not working as expected #636

Closed
dnicolson opened this issue Dec 28, 2022 · 4 comments
Closed

Bug: Max retry functionality not working as expected #636

dnicolson opened this issue Dec 28, 2022 · 4 comments
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@dnicolson
Copy link
Collaborator

dnicolson commented Dec 28, 2022

Describe The Bug

When BLE connection errors occur it seems that discover needs to be called again and not just turnOn/turnOff. I tested with 5 second intervals for minutes and the result of the log output below did not change.

To Reproduce

Turn a Bot off and on repeatedly

Expected behavior

Retry attempts to have a different result

Relevant log output

[28/12/2022, 19:13:59] [SwitchBot] Retrying
[28/12/2022, 19:14:00] [SwitchBot] TypeError: Cannot read properties of null (reading 'write')

Config for homebridge-switchbot

{
    "deviceId": "D787C65C8DEB",
    "configDeviceName": "Light",
    "configDeviceType": "Bot",
    "connectionType": "BLE",
    "bot": {
        "mode": "switch",
        "deviceType": "switch"
    },
    "maxRetry": 5,
    "logging": "standard"
}

Screenshots

No response

Device & Model

SwitchBot Bot

Node.js Version

v18.12.1

NPM Version

v8.19.2

Homebridge Version

v1.6.0

Homebridge Switchbot Plugin Version

v2.4.0

Homebridge Config UI X Plugin Version

v4.50.2

Operating System

Raspian

@donavanbecker
Copy link
Collaborator

latest beta has the latest node-switchbot beta as a dependency.

@dnicolson
Copy link
Collaborator Author

That helps with the error messages, it doesn't affect the retry behavior though.

@github-actions github-actions bot added the stale label Feb 3, 2023
@OpenWonderLabs OpenWonderLabs deleted a comment from github-actions bot Feb 3, 2023
@donavanbecker donavanbecker added invalid This doesn't seem right and removed stale labels Feb 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Mar 6, 2023
@dnicolson
Copy link
Collaborator Author

@donavanbecker I'm not sure why this is invalid, I plan to submit a pull request with the proposed fix after #690 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

7 participants