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

let berry drivers provide "after_teleperiod" handlers #21351

Merged
merged 1 commit into from May 5, 2024

Conversation

dgwynne
Copy link
Contributor

@dgwynne dgwynne commented May 5, 2024

This is useful if you want to periodically report the state of something handled separately to the sensors output.

Description:

I'm working on Yet Another(tm) driver for micradar devices, the R60ASM1 in particular, which seems to work in a similar fashion to a TuyaMCU device in that it has a concept of independent datapoints that report at different times. Because there are so many different datapoints, the driver relays their updates as separate mqtt topics, (eg, tele/%topic%/R60ASM1/BreathingRate or tele/%topic%/R60ASM1/MonitorSwitch) rather than shove several dozen bits of info into the SENSORS or STATE payloads. Some datapoints are updated very infrequently, so it's handy to report them every teleperiod so stupid downstream systems (eg, HA) don't forget what's going on.

C drivers can hook FUNC_AFTER_TELEPERIOD for similar reasons. This extends it to Berry drivers too.

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.6
  • The code change is tested and works with Tasmota core ESP32 V.3.0.0
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

this is useful if you want to periodically report the state of something
handled separately to the sensors output.
@dgwynne
Copy link
Contributor Author

dgwynne commented May 5, 2024

https://github.com/dgwynne/berry is where the berry driver is atm.

@s-hadinger
Copy link
Collaborator

Awesome, thanks

@s-hadinger s-hadinger merged commit cced3d1 into arendst:development May 5, 2024
59 checks passed
hawa-lc4 pushed a commit to hawa-lc4/Tasmota-dev that referenced this pull request May 7, 2024
this is useful if you want to periodically report the state of something
handled separately to the sensors output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants