Commit graph

748 commits

Author SHA1 Message Date
Landry Breuil
3dfc0598f8 openbsd: improve logic wrt sensor type
in case some sensors are in AMPHOUR/AMPS and others in WATTHOUR/WATTS,
don't assume they are all the same type. As a benefit, shrinks the
code a bit.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06 13:40:50 +00:00
Landry Breuil
37ff0d4ddb openbsd: fix energy-rate calculation
since acpibat.c r1.59, bst_rate type is SENSOR_AMPS or SENSOR_WATTS
and value has been corrected. Tweak accordingly.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06 13:40:50 +00:00
Landry Breuil
60e474ead5 openbsd: use a singleton pattern to access /dev/apm
up_apm_get_fd() opens /dev/apm  only if it's not already opened.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06 13:40:50 +00:00
Landry Breuil
6c15694dbb openbsd: Fix history by not trying to refresh if /dev/apm wasn't opened yet
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06 13:40:46 +00:00
Richard Hughes
3db50b0338 trivial: post release version bump 2011-12-05 09:50:44 +00:00
Richard Hughes
6600d371d3 Released UPower 0.9.15 2011-12-05 09:49:35 +00:00
Martin Pitt
6bb3623d46 src/linux/integration-test: Fail gracefully if GI is not available 2011-12-05 10:44:35 +01:00
Martin Pitt
8fc9a1d750 Fix invocation of src/linux/integration-test
In Makefile.am "check", do not call the test suite through "python". Just call
it directly and let the hashbang take care of the interpreter.
2011-12-05 10:32:04 +01:00
Martin Pitt
492a8c2283 Revert "src/linux/integration-test: Do not crash on absent _outcomeForDoCleanups"
This reverts commit 14761c09d2.

The real reason for the failure is that Makefile.am calls the script with
"python" which is Python 2, but we need Python 3.
2011-12-05 10:30:14 +01:00
Martin Pitt
14761c09d2 src/linux/integration-test: Do not crash on absent _outcomeForDoCleanups
unittest.TestCase unfortunately does not have any public API to check whether
a test case succeeded, so we use the private self._outcomeForDoCleanups. This
does not seem to exist every time, so avoid a crash if it doesn't.
2011-12-05 10:24:37 +01:00
Heiko Stübner
88c6d141ef upower: Handle Linux power supplies not exporting a present property
According to Anton Vorontsov (Linux power supply maintainer) power
supplies should not export a present property when they are not
hotpluggable and users of the properties should handle supplies
without present-property as always present.

This patch implements this feature using an additional
sysfs_file_exists call before sysfs_get_bool.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-12-03 13:10:08 +00:00
Richard Hughes
6b685799cc trivial: USB devices are assumed to be 5V 2011-11-29 15:59:36 +00:00
Richard Hughes
21da4824a7 trivial: fix the name of the percentage file 2011-11-29 15:47:26 +00:00
Richard Hughes
c7cf8aa16a Don't assert when the power_supply device type is usb 2011-11-29 15:42:24 +00:00
Richard Hughes
3901d902fd Move the wacom hack to allow us to support other types of USB device 2011-11-29 14:05:18 +00:00
Richard Hughes
d4ea1cb566 If a power-supply device doesn't report charge or energy, try to read the percentage 2011-11-29 14:04:22 +00:00
Martin Pitt
46f1c7f028 Fix crash in up_device_csr_finalize()
Spotted when running regression tests in KVM. There, initializing a HID device
causes a "could not initialize libusb: -99" warning, but the device is created
nevertheless. Do not crash in _finalize() by trying to call libusb_exit(NULL).
2011-11-11 15:50:15 +01:00
Martin Pitt
d92aec6520 src/linux/integration-test: Port to Python 3 2011-11-11 15:19:04 +01:00
Leonardo Robol
b971b43c45 Use linear regression to get better predicted battery times
For hardware that has no rate data we use the differences in charge over a time
period to work out the effective rate. Using linear regression this estimation
is much more realistic.

To do this, introduce a simple circular buffer and use an index to calculate
the rate on each update.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-10-19 17:13:51 +01:00
Richard Hughes
58f77e8aa6 Don't spam the log when we're saving history when on low power
Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=41486
2011-10-06 09:12:04 +01:00
Landry Breuil
60e5e29188 Add --with-historydir to specify where we want the history files to be stored
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-10-04 14:53:46 +01:00
Richard Hughes
5b46a00a32 trivial: post release version bump 2011-10-03 11:19:56 +01:00
Richard Hughes
b387e1a46b Released UPower 0.9.14 2011-10-03 11:18:33 +01:00
Richard Hughes
52bef2b461 Filter all the debugging details unless --verbose is specified
Now systemd is pushing all our debugging to syslog, we're upsetting some people.
2011-09-28 16:13:20 +01:00
Richard Hughes
fe643d6fc0 trivial: remove an overzealous warning when starting up 2011-09-28 16:12:40 +01:00
Christian Seiler
ff23a9c6e2 Fix linux up_backend_supports_sleep_state() return code.
Under Linux, regardless of the exit code of /usr/bin/pm-is-supported, it will
always set CanSuspend and CanHibernate to true due to a logic error in
up_backend_supports_sleep_state in src/linux/up-backend.c: The 'ret' variable
is re-used for the return code without being re-initialized to false after the
call to g_spawn_command_line_sync.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2011-09-22 17:34:45 +02:00
Pino Toscano
626c087b48 Fix the kFreeBSD detection
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-09-08 15:35:14 +01:00
Richard Hughes
e2e8dd9603 Add the website sources to git
In the case of a hit-by-a-bus event...
2011-09-06 10:02:04 +01:00
Richard Hughes
0e0333a6c8 trivial: post release version bump 2011-09-05 13:53:25 +01:00
Richard Hughes
9fc12b37b6 Released UPower 0.9.13 2011-09-05 13:52:05 +01:00
Martin Pitt
75d8c449cd src/linux/integration-test: Fully port to GI
Move from static glib to GI GLib module, to avoid mixing static and dynamic
bindings.

This fixes the tests to work with pygobject 3.
2011-09-05 14:38:31 +02:00
Richard Hughes
bc7ffea5de trivial: fix up a trivial typo in the last commit
Thanks to Emilio López for spotting it!
2011-09-02 09:46:29 +01:00
Diego Elio Pettenò
c08c35f762 build: don't rely on files' presence to define the default backend.
Files might not be there, or in the case of cross-compilation, they most
definitely won't be there (and if they are, they are not the ones you
should be looking for). Instead use the autoconf-defined $host variable to
identify for what system we're building for.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-09-01 12:21:45 +01:00
Denis Washington
785ecbb6d5 Use g_unix_signal_add_full() which has been renamed in the unstable GLib branch
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-08-31 22:43:40 +01:00
Richard Hughes
cb37dcc2e8 Hardcode wacom battery devices as not power-supply devices
We'll switch to a kernel property when the power_supply interface is fixed.
2011-07-19 16:14:20 +01:00
Richard Hughes
b19fca9637 Use git.mk and remove the manual .gitignore files 2011-07-19 12:40:21 +01:00
Javier Jardón
75894ebb2e Use upstream gettext instead the glib one 2011-07-19 12:16:30 +01:00
Javier Jardón
aabd6fb9e3 autogen.sh: Use autoreconf instead custom script 2011-07-19 11:57:50 +01:00
Javier Jardón
5bf494a9d3 configure.ac: Modernize autotools config
Require automake 1.11 as Its needed to generate xz tarballs
Remove unneded macros
2011-07-19 11:57:48 +01:00
Javier Jardón
9e32af9ef6 Avoid warnings about missing annotations
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-07-19 11:55:34 +01:00
Richard Hughes
37bc9a6f8b trivial: post release version bump 2011-07-04 16:47:16 +01:00
Richard Hughes
e3194730b8 Released UPower 0.9.12 2011-07-04 16:46:19 +01:00
Richard Hughes
1f05a6e9b0 Switch to using .xz tarballs 2011-07-04 16:46:00 +01:00
Richard Hughes
2d8358ae4e Fix how we estimate the device rate for batteries that do not provide this data
Based on a patch from Andy Eyre <andrew.eyre@medschool.ox.ac.uk>, many thanks.
2011-07-01 17:14:58 +01:00
Landry Breuil
fed9c33910 Add openbsd missing includes for close() and strcmp() 2011-05-31 11:07:52 +01:00
Landry Breuil
e495d53661 Silence some openbsd warnings about unused vars and bad return values 2011-05-31 11:07:21 +01:00
Landry Breuil
9d40aa4a2d Add AC_PROG_LIBTOOL as advised by autotools 2011-05-31 11:06:31 +01:00
Richard Hughes
390d295b5b trivial: post release version bump 2011-05-25 12:51:33 +01:00
Richard Hughes
d27dd5f4bb Released UPower 0.9.11 2011-05-25 12:50:31 +01:00
Richard Hughes
2b42890480 Only include glib-unix.h if the GLib version is >= 2.29.4
Many thanks to Takahiro HASHIMOTO for debugging the problem. Fixes fdo#37489
2011-05-23 09:42:38 +01:00