xoseperez / espurna

Home automation firmware for ESP8266-based devices
http://tinkerman.cat
GNU General Public License v3.0
3k stars 638 forks source link

feature request: Dimmer with brightness local control #508

Open hexrus opened 6 years ago

hexrus commented 6 years ago

Hello, I want attach button to GPIO04 MagicHome controller and control brightness with it button. Button click - on/off light Button hold - cyclic brightness dimmer I can not find this functions in espurna firmware. It`s realy?

xoseperez commented 6 years ago

You can define a button for the MagicHome in hardware.h that will do the on/off. But the dimmer part is not available.

In the MagicHome section of the hardware.h file add these lines. Connect the pushbutton between GPIO4 and ground.

    // Buttons
    #define BUTTON1_PIN         4
    #define BUTTON1_MODE        BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
    #define BUTTON1_RELAY       1
hexrus commented 6 years ago

Yes, I already test this solution. I intresting do you planning add button dimmer feature.

xoseperez commented 6 years ago

No, I did not have that in mind... sorry. You can try adding it yourself and do a pull request.