Adding custom actions to custom C++ cover


I am developing a custom cover esphome integration.
It is working fine for supported actions (open, close, position, etc). Code is available here: EspHome-CustomCover/esphome-cover.h at b90df4d1aec2d493305e67ce90b7759e063f1402 · gmag11/EspHome-CustomCover · GitHub

But I would like to add actions to calibrate full up and full down positions. I use a Cherubini Wave Wire 45 motor that has a sequence to set calibration points:

Is it possible to add custom actions in custom cover code to that they are available using a template button to trigger calibration actions?


I’ve solved this by the moment.
I’ve used a CustomAPIDevice definition to add a service that trigger calibration actions.
Some template buttons trigger that services through HomeAssistant.
This works as I need but it requires that device is connected to HomeAssistant. I’d like to be able to trigger calibration even if it is not connected.
I’ve updated repository with latest code