pi-top / pi-topd

pi-top System Daemon (formerly pt-device-manager)
6 stars 4 forks source link

Send messages only when app is initialized #171

Closed jcapona closed 1 year ago

jcapona commented 1 year ago
Status Ticket/Issue
Ready/Hold Ticket

Main changes

When the application starts, several messages are being published after the hub is polled to learn the current state of the hub. This causes issues since messages will be sent even if the event that triggers them isn't happening.

The messages that are currently being sent every time the application starts are:

PUB_BATTERY_STATE_CHANGED
PUB_OLED_CONTROL_CHANGED
PUB_OLED_SPI_BUS_CHANGED
PUB_V3_BUTTON_UP_RELEASED
PUB_V3_BUTTON_DOWN_RELEASED
PUB_V3_BUTTON_SELECT_RELEASED
PUB_V3_BUTTON_CANCEL_RELEASED

The changes in this PR will cause pi-topd to stop sending these messages until the app is initialized. Also, a new message PUB_PITOPD_READY is published when this happens, to let other applications know about this.

Screenshots (feature, test output, profiling, dev tools etc)

[insert screenshots here]

Other notes (e.g. implementation quirks, edge cases, questions / issues)

-

Manual testing tips

-

Tag anyone who definitely needs to review or help

-