athom-tech / athom-configs

Athom Technology Official Center
MIT License
212 stars 134 forks source link

Smart plugs: add ID for power button #85

Closed tari closed 2 months ago

tari commented 2 months ago

Setting an ID for the power button allows its behavior to be extended or modified by configuration that uses this package, for example:

packages:
  Athom_Technology.Smart_Plug_V2: github://athom-tech/athom-configs/athom-smart-plug-v2.yaml

binary_sensor:
  - id: !extend power_button
    # Additional settings here
Roving-Ronin commented 2 months ago

If your wanting to get this added in, I would suggest that you also add this into the:

v1 Plug: https://github.com/athom-tech/athom-configs/blob/main/athom-smart-plug.yaml

v3 Plug: https://github.com/athom-tech/esp32-configs/blob/main/athom-smart-plug.yaml

to ensure consistency of the functionality / code between ALL versions of the plug. Previously this was lacking, but in the last few months was just fixed up.

tari commented 2 months ago

That's reasonable. Added the same change to v1 here, and v3 in https://github.com/athom-tech/esp32-configs/pull/27.