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.

Battery

Questions and comments specific to a particular plugin should go here.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Battery

Post 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
Attachments
__init__.py
Version 0.0
(24.16 KiB) Downloaded 423 times
You know flattr ? You can Image
eirik226
Experienced User
Posts: 142
Joined: Wed Nov 07, 2012 5:22 pm

Re: Battery

Post by eirik226 »

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

Post 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.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Battery

Post 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
You know flattr ? You can Image
HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Battery

Post 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.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Battery

Post 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
You know flattr ? You can Image
HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Battery

Post by HTPCanwender »

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

Post by reinholdkorst »

Hou must i put the plugin in EG. I can`t get it woring.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Battery

Post 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
You know flattr ? You can Image
reinholdkorst
Posts: 13
Joined: Fri Feb 20, 2015 8:34 pm

Re: Battery

Post by reinholdkorst »

I have don this but i cant see the plugin i have the newest eventghost.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Battery

Post 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
You know flattr ? You can Image
reinholdkorst
Posts: 13
Joined: Fri Feb 20, 2015 8:34 pm

Re: Battery

Post by reinholdkorst »

This what i get

Image

I dont see the plugin. I save it the way you explane.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Battery

Post 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
Attachments
BatteryDir.png
You know flattr ? You can Image
reinholdkorst
Posts: 13
Joined: Fri Feb 20, 2015 8:34 pm

Re: Battery

Post 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']
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Battery

Post 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
You know flattr ? You can Image
Post Reply