jensrossbach / esphome-ferraris-meter

ESPHome component for measuring current power and overall energy consumption using an analog Ferraris electricity meter
MIT License
2 stars 1 forks source link

Replace Ferraris number and button components with template components #3

Closed jensrossbach closed 1 month ago

jensrossbach commented 1 month ago

This pull request replaces the Ferraris number and button components (which were used to overwrite the energy meter reading value) with template variants from the YAML configuration file. Additionally, the Ferraris component now provides two actions ferraris.set_energy_meter and ferraris.set_rotation_counter which can be used to set the energy meter reading value and the rotation counter respectively (the latter is updated with both actions as the Ferraris component internally works with rotations only).

The new template number and button components make use of the ferraris.set_energy_meter action to overwrite the energy meter reading value. As these components are now part of the YAML file and no more part of the C++ component code, they can be easily adapted to custom needs.

Closes #2