Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Mqtt and other small fixes#33

Merged
TheTimeWalker merged 4 commits into
TheTimeWalker:masterfrom
FredericMa:mqtt_and_other_small_fixes
Oct 11, 2022
Merged

Mqtt and other small fixes#33
TheTimeWalker merged 4 commits into
TheTimeWalker:masterfrom
FredericMa:mqtt_and_other_small_fixes

Conversation

@FredericMa

Copy link
Copy Markdown
Contributor

Fixes #29

I've managed to fix the issues I was facing in #29.
The mqtt reconnect logic suffered the same issue. Basically it was possible that multiple callbacks were added to the handlers.
I've added a cleanup before every addition to the handlers to make sure only one callback will be in the handler.
I'm not an android developer so I've basically just hardened the logic to prevent the issue from happening.

I've also did some other minor fixes like using the displaymanager to get the state of the screen since "isInteractive" on the power manager doesn't necessarily represents the correct screen state (https://developer.android.com/reference/android/os/PowerManager#isInteractive())

- Remove MQTT3 disconnect exception handling MQTT5 service.
- Remove MQTT5 disconnect exception handling MQTT3 service.
- Correct wrong set of mReady (should be false) and wrong call of handleMqttConnected (should be handleMqttDisconnected)
- Fixed typo.
- Remove irrelevant mqttConnected variable
- Use displayManager to get real display state (see bottom remark of: https://developer.android.com/reference/android/os/PowerManager#isScreenOn())
@netlify

netlify Bot commented Oct 2, 2022

Copy link
Copy Markdown

Deploy Preview for wallpanel canceled.

Name Link
🔨 Latest commit e68ca03
🔍 Latest deploy log https://app.netlify.com/sites/wallpanel/deploys/6339555f75c7d20008603446

@TheTimeWalker

Copy link
Copy Markdown
Owner

Thank you very much for looking into this issue! I will look into the PR in the following days

@TheTimeWalker

Copy link
Copy Markdown
Owner

LGTM!

@TheTimeWalker TheTimeWalker merged commit 3420d61 into TheTimeWalker:master Oct 11, 2022
@FredericMa FredericMa deleted the mqtt_and_other_small_fixes branch October 12, 2022 05:36
@FredericMa

Copy link
Copy Markdown
Contributor Author

Thanks for merging! Is there also a new release going to be published?

@TheTimeWalker

Copy link
Copy Markdown
Owner

Yes, hopefully today

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Endless loop MQTT battery sensor publish

2 participants