devWaves / SwitchBot-MQTT-BLE-ESP32

Allows for multiple SwitchBot bots and curtains to be controlled via MQTT sent to ESP32. ESP32 will send BLE commands to switchbots and return MQTT responses to the broker. Also supports Temperature, Motion, Contact sensors
MIT License
531 stars 66 forks source link

Press Mode on SwitchBot Bot #46

Closed jeffconrad18 closed 2 years ago

jeffconrad18 commented 2 years ago

Hey DevWaves, it would be very cool if you add the new Home Assistant Feature "button entity", so if the Press-Mode is on, it appears as a Button in HA! Thanks for your work! Jeff

devWaves commented 2 years ago

I will think about it, but it is only a visual thing. The default state of the switch is OFF and it acts as a button already

.... I guess I can just add another entity after thinking about it. I'll look into it

devWaves commented 2 years ago

button entity option added to v6.6

depending on the bot type you pick, it will create the proper HA entity

/* Switchbot Bot Device Types - OPTIONAL */
/* Options include: "switch", "light", "button" */
static std::map<std::string, std::string> allBotTypes = {     // OPTIONAL - (DEFAULTS to "switch" if bot is not in list) - Will create HA entities for device types
 /* { "switchbotone", "switch" },
    { "switchbottwo", "light" },
    { "switchbotthree", "button" }*/
};