Battery: support for ac connection event cmd

This add two new config options "ac_connected_cmd" and
"ac_disconnected_cmd". These commands are executed when
AC (mains supply) is connected or disconnected.
This commit is contained in:
Sebastian Reichel
2015-08-07 05:20:24 +02:00
parent 3c45cf29c7
commit db490247e0
4 changed files with 33 additions and 0 deletions

View File

@@ -392,6 +392,18 @@ void add_entry (char *key, char *value)
#ifdef ENABLE_BATTERY
if (strlen(value) > 0)
battery_low_cmd = strdup (value);
#endif
}
else if (strcmp (key, "ac_connected_cmd") == 0) {
#ifdef ENABLE_BATTERY
if (strlen(value) > 0)
ac_connected_cmd = strdup (value);
#endif
}
else if (strcmp (key, "ac_disconnected_cmd") == 0) {
#ifdef ENABLE_BATTERY
if (strlen(value) > 0)
ac_disconnected_cmd = strdup (value);
#endif
}
else if (strcmp (key, "bat1_font") == 0) {