From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?J=E9r=E9my_Compostella?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] battery.el Retrieve more information from sysfs Date: Wed, 21 Dec 2011 11:03:47 +0100 Message-ID: References: <87r50190eb.fsf@Apollo.jerryland.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec501c42affaf0904b4974d58 X-Trace: dough.gmane.org 1324461871 21235 80.91.229.12 (21 Dec 2011 10:04:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Dec 2011 10:04:31 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 21 11:04:27 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RdJ2B-0008RL-4a for ged-emacs-devel@m.gmane.org; Wed, 21 Dec 2011 11:04:27 +0100 Original-Received: from localhost ([::1]:50122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdJ2A-0004ek-1N for ged-emacs-devel@m.gmane.org; Wed, 21 Dec 2011 05:04:26 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdJ23-0004dc-QC for emacs-devel@gnu.org; Wed, 21 Dec 2011 05:04:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdJ1t-0001Oy-Om for emacs-devel@gnu.org; Wed, 21 Dec 2011 05:04:19 -0500 Original-Received: from mail-vx0-f169.google.com ([209.85.220.169]:59403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdJ1t-0001OX-Fa for emacs-devel@gnu.org; Wed, 21 Dec 2011 05:04:09 -0500 Original-Received: by vcge1 with SMTP id e1so5586639vcg.0 for ; Wed, 21 Dec 2011 02:04:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=FhuvrThoQTO9tAyOIVVrFjMAk3VJ09ssQ4Pm21zj4/Y=; b=JGmxnevdi8HplM4D4dEjvSuzZuKgC9Pq9k0a6R8uc1BANywfKy3xAeVmLBGSlI/yed Ze8XgcmyNkcstyB5JWIOOahZZY8A2buyBTd9eoZYLm6RXT3O9SoWCYKxPM9EsJTT0L1u ekmhLEa1zUXCRzdxIxVVEBO1hYFXJKdz9vuN4= Original-Received: by 10.52.74.229 with SMTP id x5mr3329248vdv.29.1324461848505; Wed, 21 Dec 2011 02:04:08 -0800 (PST) Original-Received: by 10.52.114.3 with HTTP; Wed, 21 Dec 2011 02:03:47 -0800 (PST) In-Reply-To: <87r50190eb.fsf@Apollo.jerryland.fr> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.220.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146892 Archived-At: --bcaec501c42affaf0904b4974d58 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable All again, I did not received any answers so I'm answering myself about : - Do I miss something in the "submit" process, - Is this patch is a mess ? - Or maybe everybody is busy ... So let me know, Thanks, Jeremy 2011/12/18 J=E9r=E9my Compostella > All, > > I just bought a new laptop and installed a fresh Debian on it. I used to > look at my current battery status using Emacs. I like to look at the > current rate too since this laptop will be used during a long trip and I > want to take care of the consumption in real time. > > The issue is that with the 2.6.32 kernel from Debian for this laptop I > do not have the /proc/acpi/battery part. However, the sysfs is able to > report all the data I need. The current Emacs battery module is not able > to retrieve the information I need from sysfs but it does from > /proc/acpi/battery. So I made a small evolution to enable the following: > > - Get the current rate > - Get the current temperature (does not work on my laptop but the > power_supply interface is able to provide it, so I added it too. > - Do the time remaining estimation using the current voltage, the > remaining capacity and the current rate. It works on both charging and > discharging state. > > I attached the patch but I warn you that it has been generated using git > since I was unable to retrieve the bazar repository for the last two > days (it hangs during the download process). By the way, do you have any > advice which could help me ? > > Please merge it or review it. > > Best regards, > > > Jeremy > > PS: I signed my Emacs assignment and post it by mail 10 days ago. > -- > Sent from my Emacs > > --=20 One Emacs to rule them all --bcaec501c42affaf0904b4974d58 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable All again,

I did not received any answers so I'm answering mysel= f about :
- Do I miss something in the "submit" process,
- = Is this patch is a mess ?
- Or maybe everybody is busy ...

So let= me know,

Thanks,

Jeremy

2011/12/18 J=E9= r=E9my Compostella <jeremy.compostella@gmail.com>
All,

I just bought a new laptop and installed a fresh Debian on it. I used to look at my current battery status using Emacs. I like to look at the
current rate too since this laptop will be used during a long trip and I want to take care of the consumption in real time.

The issue is that with the 2.6.32 kernel from Debian for this laptop I
do not have the /proc/acpi/battery part. However, the sysfs is able to
report all the data I need. The current Emacs battery module is not able to retrieve the information I need from sysfs but it does from
/proc/acpi/battery. So I made a small evolution to enable the following:
- Get the current rate
- Get the current temperature (does not work on my laptop but the
=A0power_supply interface is able to provide it, so I added it too.
- Do the time remaining estimation using the current voltage, the
=A0remaining capacity and the current rate. It works on both charging and<= br> =A0discharging state.

I attached the patch but I warn you that it has been generated using git since I was unable to retrieve the bazar repository for the last two
days (it hangs during the download process). By the way, do you have any advice which could help me ?

Please merge it or review it.

Best regards,


Jeremy

PS: I signed my Emacs assignment and post it by mail 10 days ago.
--
Sent from my Emacs


--
One Emacs to rule them all
--bcaec501c42affaf0904b4974d58--