Skip to content

Missing battery info messages #2

@codeaholics

Description

@codeaholics

Battery info decoder has a strange filter at the top. It only passes messages from "sensors" (07) or to "controllers" (01). It seems that HR92s, at least, send two messages - one addressed to themselves, and one to the controller. However, some devices (07, 22, 34) appear only to send messages addressed to themselves. This means that battery levels for device types 22 and 34 are currently dropped.

We can't just drop the ones addressed to the controller and accept the self-addressed ones, because there might be some devices which only send messages addressed to the controller and they'd get dropped.

Perhaps we can employ a cache here? Device ID -> battery level. Accept all types of messages, but only produce output when the battery level changes for a given device? Maybe expire cache entries after a short time - like one second - so we just squash one of the messages that are sent in pairs?

Or simply pass all messages!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions