/*
+ * The display is a lin-log chart of the charge over time.
+ * Time is on a log scale.
+ * The top pixel line is 60s from now.
+ * The bottom of the window is 1h from now.
+ *
* display outputs, per line:
*
* Remaining: | Empty: | Degraded:
* blue | black | dimgrey discharging
* green | black | dimgrey charging
* cyan | black | dimgrey charged
- * grey | black | dimgrey charging&discharching!
+ * grey | black | dimgrey charging&discharging!
* lightgrey | black | dimgrey none of the above
* blue | red | dimgrey discharging - low!
* green | red | dimgrey charging - low
* cyan | red | dimgrey charged - low [1]
- * grey | red | dimgrey charging&discharching, low [1]
+ * grey | red | dimgrey charging&discharging, low [1]
* ... darkgreen ... no batteries present
* ... yellow ... error
*
ALL_DIRECT_VARS(V_PRINT)
}
+ if (this_type == -1) {
+ /* some kernels don't seem to provide TYPE in the uevent
+ * guess the type from whether we see "present" or "online" */
+ if (this_online >= 0 && this_present == -1) this_type = TYPE_MAINS;
+ if (this_online == -1 && this_present >= 0) this_type = TYPE_BATTERY;
+ if (debug)
+ printf(" type absent from uevent %6s guessed %12s %"PRId64"\n",
+ "", "", this_type);
+ }
+
int needsfields_MAINS = this_type == TYPE_MAINS;
int needsfields_BATTERY = this_type == TYPE_BATTERY;
int needsfields_BOTH = 1;