From f74ae1994404f7b34c25697f2009b1fb3f1ee106 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 4 Dec 2009 01:37:32 +0100 Subject: [PATCH] convert apcupsd_loadbarval to double --- src/apcupsd.c | 4 ++-- src/apcupsd.h | 2 +- src/core.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apcupsd.c b/src/apcupsd.c index 143e2a74..eb2c0bea 100644 --- a/src/apcupsd.c +++ b/src/apcupsd.c @@ -229,11 +229,11 @@ void update_apcupsd(void) { return; } -uint8_t apcupsd_loadbarval(struct text_object *obj) +double apcupsd_loadbarval(struct text_object *obj) { (void)obj; - return round_to_int(atof(info.apcupsd.items[APCUPSD_LOAD]) * 2.55); + return atof(info.apcupsd.items[APCUPSD_LOAD]); } #define APCUPSD_PRINT_GENERATOR(name, idx) \ diff --git a/src/apcupsd.h b/src/apcupsd.h index db6ff02f..5e2a2db3 100644 --- a/src/apcupsd.h +++ b/src/apcupsd.h @@ -51,7 +51,7 @@ typedef struct apcupsd_s { /* Service routine for the conky main thread */ void update_apcupsd(void); -uint8_t apcupsd_loadbarval(struct text_object *); +double apcupsd_loadbarval(struct text_object *); void print_apcupsd_name(struct text_object *, char *, int); void print_apcupsd_model(struct text_object *, char *, int); diff --git a/src/core.c b/src/core.c index 32aa1c04..69b748f5 100644 --- a/src/core.c +++ b/src/core.c @@ -1571,17 +1571,17 @@ struct text_object *construct_text_object(const char *s, const char *arg, long END OBJ(apcupsd_load, &update_apcupsd) obj->callbacks.print = &print_apcupsd_load; END OBJ(apcupsd_loadbar, &update_apcupsd) - scan_bar(obj, arg, 255); + scan_bar(obj, arg, 100); obj->callbacks.barval = &apcupsd_loadbarval; #ifdef X11 END OBJ(apcupsd_loadgraph, &update_apcupsd) char* buf = 0; - buf = scan_graph(obj, arg, 255); + buf = scan_graph(obj, arg, 100); if (buf) free(buf); obj->callbacks.graphval = &apcupsd_loadbarval; #endif /* X11 */ END OBJ(apcupsd_loadgauge, &update_apcupsd) - scan_gauge(obj, arg, 255); + scan_gauge(obj, arg, 100); obj->callbacks.gaugeval = &apcupsd_loadbarval; END OBJ(apcupsd_charge, &update_apcupsd) obj->callbacks.print = &print_apcupsd_charge;