Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Battery
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Battery
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
So I created one.
Any opinion on this is welcome!
Pako
- Attachments
-
- __init__.py
- Version 0.0
- (24.16 KiB) Downloaded 423 times
You know flattr ? You can 

Re: Battery
Neat! I'll look into this later
Thanks!
-
HTPCanwender
- Experienced User
- Posts: 89
- Joined: Wed Feb 08, 2012 9:41 pm
- Location: Germany
Re: Battery
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'
The Events seem to work anyway.
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'
The Events seem to work anyway.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Battery
I forgot to point out that this plugin requires the EventGhost version r1669 or later.HTPCanwender wrote:Traceback (most recent call last) (1640):
Pako
You know flattr ? You can 

-
HTPCanwender
- Experienced User
- Posts: 89
- Joined: Wed Feb 08, 2012 9:41 pm
- Location: Germany
Re: Battery
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.
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.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Battery
This way it works.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.
The event is triggered if the obtained percentage is less than or equal to the set value.
Pako
You know flattr ? You can 

-
HTPCanwender
- Experienced User
- Posts: 89
- Joined: Wed Feb 08, 2012 9:41 pm
- Location: Germany
Re: Battery
At the moment I have no additional comments. The plugin works fine.
-
reinholdkorst
- Posts: 13
- Joined: Fri Feb 20, 2015 8:34 pm
Re: Battery
Hou must i put the plugin in EG. I can`t get it woring.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Battery
1) In the folder ...\EventGhost\plugins you create a new folder Batteryreinholdkorst wrote:Hou must i put the plugin in EG. I can`t get it woring.
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
You know flattr ? You can 

-
reinholdkorst
- Posts: 13
- Joined: Fri Feb 20, 2015 8:34 pm
Re: Battery
I have don this but i cant see the plugin i have the newest eventghost.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Battery
Can you please clarify?reinholdkorst wrote:I have don this but i cant see the plugin i have the newest eventghost.
You can not see it before adding or after adding?Pako
You know flattr ? You can 

-
reinholdkorst
- Posts: 13
- Joined: Fri Feb 20, 2015 8:34 pm
Re: Battery
This what i get

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

I dont see the plugin. I save it the way you explane.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Battery
It is at least strange.reinholdkorst wrote:I dont see the plugin. I save it the way you explane.
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")Pako
You know flattr ? You can 

-
reinholdkorst
- Posts: 13
- Joined: Fri Feb 20, 2015 8:34 pm
Re: Battery
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']
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']
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Battery
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
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
You know flattr ? You can 
