ClemensElflein / OpenMower

Let's upgrade cheap off-the-shelf robotic mowers to modern, smart RTK GPS based lawn mowing robots!
Other
4.64k stars 274 forks source link

Better support for CoverUI's "with Display" Proposal #78

Closed Apehaenger closed 5 months ago

Apehaenger commented 10 months ago

Issue

When porting a stock CoverUI with some kind of display (instead of simple LEDs), it's currently required to translate the LED states (on, off, blink_slow, blink_fast) back to some kind a displayable value. This is somehow cumbersome as well as inaccurate (i.e. charging state is currently represented by one LED).

Because updating the CoverUI is painful (you've to open the mower), it's required to find a solution which doesn't influence current implementations in any way.

Approach

Implement some kind of request which has to be initiated by the CoverUI's FW which is interested in other data than the current Set_LEDs packet.

Implementation

For this, I added the msg_event_subscribe packet, which can be requested by the CoverUI to "subscribe" to specific data. Default to Set_LEDs packet, so that current installations work as before.

Summary

This is a proposal. Nothing tested yet. Like to know you thoughts. As I expect to get two more stock CoverUI's the next days, and one will have a display again, I like to find a solution which is clear and stable for some longer time.

Apehaenger commented 9 months ago

Implemented CoverUI- subscription functionality in Stock- SAxPRO model, and tested with and without subscription, also with C500B and RM-ECOW-V1.0.0 (NX80i) CoverUIs. Works as expected. Would be cool if it could be merged as it's required now for SAxPRO and will also be required by (future) NX100i CoverUI port.

ClemensElflein commented 5 months ago

LGTM, thank you for the PR.