serkri / SmartEVSE-3

Smart Electric Vehicle Charging Station (EVSE)
MIT License
71 stars 27 forks source link

API Settings to turn on backlight #112

Closed evanes68 closed 1 year ago

evanes68 commented 1 year ago

I have the Smartevse in my garage and would like to have the backlight on when I walk in the room. I was delighted to see this function in the API using the settings POST. The logic however does not work.

I found the bug is on line 3105: ledcWrite(LCD_CHANNEL, backlight); should be: BacklightTimer = backlight * BACKLIGHT;

I tested this and it works.

Another little request I have is that my home automation (loxone) has the option to read values using http GET, but the value must be numeric. I would like to add a parameter for car_connected_id having 1 or 0.

Adding this after line 3002: doc["car_connected_id"] = evConnected ? 1 : 0;

would both be welcome enhancements.

thank you for the great work!

dingo35 commented 1 year ago

Thanks for your work, leave this issue open so I can test it myself.

As to the REST API, you must understand that we cannot change that interface for every crippled interface handler; it would be better to change that software to handle any GET response, as non numeric get responses are quite standard.

dingo35 commented 1 year ago

Committed in bb536e2aa93