b10503ddf1
git-svn-id: http://www.neo1973-germany.de/svn@187 46df4e5c-bc4e-4628-a0fc-830ba316316d
38 lines
1.5 KiB
Python
38 lines
1.5 KiB
Python
#!/usr/bin/env python2.5
|
|
# -*- coding: utf-8 -*-
|
|
__author__ = "Soeren Apel (abraxa@dar-clan.de), Frank Gau (fgau@gau-net.de), Thomas Gstaedner (thomas (a) gstaedtner (.) net)"
|
|
__version__ = "prototype"
|
|
__copyright__ = "Copyright (c) 2008"
|
|
__license__ = "GPL3"
|
|
|
|
from epydial import *
|
|
|
|
class GsmStatusScreen(EdjeGroup):
|
|
def __init__(self, screen_manager):
|
|
EdjeGroup.__init__(self, screen_manager, GSM_STATUS_SCREEN_NAME)
|
|
|
|
def register_pyneo_callbacks(self):
|
|
PyneoController.register_callback("power_status_gsm", self.on_power_status_gsm)
|
|
PyneoController.register_callback("pwr_status_change", self.on_pwr_status_change)
|
|
|
|
def on_pwr_status_change(self, status):
|
|
self.part_text_set("pwr_caption", "battemp: %s<br>chgmode: %s<br>chgstate: %s<br>chgcur: %s<br>battvolt: %f"%(status['battemp'], status['chgmode'], status['chgstate'], status['chgcur'], status['battvolt']))
|
|
|
|
def on_power_status_gsm(self, status):
|
|
if status: p_status = "on"
|
|
else: p_status = "off"
|
|
print '--- gsm device is ', p_status
|
|
self.part_text_set("button_11_caption", p_status)
|
|
self.part_text_set("pwr_caption", "gsm device is %s"%p_status)
|
|
|
|
@edje.decorators.signal_callback("gsm_send", "*")
|
|
def on_edje_signal_dialer_status_triggered(self, emission, source):
|
|
status = self.part_text_get("button_11_caption")
|
|
if source == "<":
|
|
PyneoController.show_dialer_screen()
|
|
if source == "on" and status == "on": PyneoController.power_down_gsm()
|
|
elif source == "on" and status == "off":
|
|
self.first = time.time()
|
|
PyneoController.power_up_gsm()
|
|
|
|
|