Page 1 of 3

Battery

Posted: Fri Sep 12, 2014 2:54 pm
by Pako
I realized that here is missing a plugin that would monitor the battery charge status.
So I created one.
Any opinion on this is welcome!

Pako

Re: Battery

Posted: Sat Sep 13, 2014 12:42 am
by eirik226
Neat! I'll look into this later :) Thanks!

Re: Battery

Posted: Sat Sep 13, 2014 12:51 pm
by HTPCanwender
Hi Pako,
I get an error message, when I save the configuration of the plugin.

Traceback (most recent call last) (1640):
File "C:\Program Files (x86)\EventGhost\eg\Classes\Scheduler.py", line 137, in MainLoop
func(*args, **kwargs)
File "C:\Program Files (x86)\EventGhost\plugins\Battery\__init__.py", line 498, in worker
if task[1] == ST.LongTask:
AttributeError: 'Scheduler' object has no attribute 'LongTask'
Battery.png
The Events seem to work anyway.

Re: Battery

Posted: Sat Sep 13, 2014 2:40 pm
by Pako
HTPCanwender wrote:Traceback (most recent call last) (1640):
I forgot to point out that this plugin requires the EventGhost version r1669 or later.
Pako

Re: Battery

Posted: Sun Sep 14, 2014 10:37 am
by HTPCanwender
I have updated EG. The plugin works now.

I have an additional remark. Perhaps it would be better to fire an Event when the percentage is in a defined interval and not a certain value. Otherwise it could happen that the percentage is skipped when the polling period is too Long.

Re: Battery

Posted: Sun Sep 14, 2014 11:47 am
by Pako
HTPCanwender wrote:Perhaps it would be better to fire an Event when the percentage is in a defined interval and not a certain value. Otherwise it could happen that the percentage is skipped when the polling period is too Long.
This way it works.
The event is triggered if the obtained percentage is less than or equal to the set value.

Pako

Re: Battery

Posted: Sun Sep 14, 2014 6:44 pm
by HTPCanwender
At the moment I have no additional comments. The plugin works fine.

Re: Battery

Posted: Sun Feb 22, 2015 1:17 pm
by reinholdkorst
Hou must i put the plugin in EG. I can`t get it woring.

Re: Battery

Posted: Sun Feb 22, 2015 2:15 pm
by Pako
reinholdkorst wrote:Hou must i put the plugin in EG. I can`t get it woring.
1) In the folder ...\EventGhost\plugins you create a new folder Battery
2) Using the right mouse button and "Save as" you download the file __init__.py from first post
3) The file you save into the folder you created in step 1)
4) Restart your EventGhost
5) Add new plugin to your configuration tree

Pako

Re: Battery

Posted: Sun Feb 22, 2015 3:22 pm
by reinholdkorst
I have don this but i cant see the plugin i have the newest eventghost.

Re: Battery

Posted: Sun Feb 22, 2015 3:47 pm
by Pako
reinholdkorst wrote:I have don this but i cant see the plugin i have the newest eventghost.
Can you please clarify?
You can not see it before adding or after adding?
BatteryPluginAdd.png
Pako

Re: Battery

Posted: Sun Feb 22, 2015 4:29 pm
by reinholdkorst
This what i get

Image

I dont see the plugin. I save it the way you explane.

Re: Battery

Posted: Sun Feb 22, 2015 4:53 pm
by Pako
reinholdkorst wrote:I dont see the plugin. I save it the way you explane.
It is at least strange.
Are you sure you did it exactly as instructed?
Please open the Python Shell window (Help menu) and type two commands as in the attached picture.

Code: Select all

import os
print os.listdir(eg.pluginDirs[0]+"\\Battery")
Then put the result here.

Pako

Re: Battery

Posted: Sun Feb 22, 2015 5:19 pm
by reinholdkorst
PyCrust 0.9.8 - The Flakiest Python Shell
Python 2.6.5 Stackless 3.1b3 060516 (release26-maint, Mar 20 2010, 15:26:51) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import os
print os.listdir(eg.pluginDirs[0]+"\\Battery")
[u'__init__.py', u'__init__.pyc']

Re: Battery

Posted: Sun Feb 22, 2015 6:05 pm
by Pako
It looks right.
I do not know what's wrong.
Please try EventGhost run with command line option -debug.
The log file will be created.
In Windows 7 it is located in C:\Users\<USER>\AppData\Roaming\EventGhost\Log.txt.
Please attach the file here.

Pako