Are you sure your UPS device is actually being read as a Joystick? 
Exactly what kind of UPS do you have, and how is it connected to the 
computer?

There are probably better tools for doing what you want to do than 
pygame.

---
James Paige

On Wed, Apr 13, 2011 at 12:42:18AM +0200, slawko.skrzy...@poczta.fm wrote:
> Hello,
> 
> I would like to get some information whether it would be possible to use 
> Pygame's Joystick package to process simple signal from UPS to trigger clean 
> shutdown of the Linux machine.
> 
> I would like to use 2 buttons from Joystick interface to sense 3 states from 
> UPS:
> A) AC power OK
> B) no AC power - using battery
> C) battery low - shutdown now
> 
> The program should run as a demon and check every 10 second if the UPS 
> entered B state. Then would monitor every second if UPS reached C state. At 
> this moment daemon should copy files stored in RAMdisk onto HDD and request 
> runging programs to close and finally invoke system shutdown.
> 
> This architecture would improve my Linux 
> net_router/web_proxy/home_automation/etc. server with simple solution using 
> existing gameport, 2 relays and some cabling, upgrading it to a "smart 
> system".  :)
> 
> 
> Is it difficult to create this piece of software ?
> 
> 
> Kind Regards,
> 
> SlawKo
> 
> ----------------------------------------------------------------
> Najlepsze oferty na domy i mieszkania w Polsce!
> Szutkaj tutaj >> http://linkint.pl/f2974
> 
> 

Reply via email to