dawidchyrzynski / arduino-home-assistant

ArduinoHA allows to integrate an Arduino/ESP based device with Home Assistant using MQTT.
https://dawidchyrzynski.github.io/arduino-home-assistant/
GNU Affero General Public License v3.0
498 stars 118 forks source link

Feature Request: HASelect.getOption #163

Closed netmindz closed 8 months ago

netmindz commented 1 year ago

It would be very useful to be able to get the string value of the current state without needing to have a separate array to map getCurrentState() back to the values used in setOptions

select.setOptions("Low;Medium;High");

want to Serial.printf("Current option: %s\", select.getOption()); rather than needing options = {"Low","Medium","High"}; Serial.printf("Current option: %s\", options[select.getCurrentState()]);

dawidchyrzynski commented 8 months ago

This feature will be available in the upcoming version of the library. Please refer to the linked Pull Request for more information.