add battvolt and chgstate

git-svn-id: http://www.neo1973-germany.de/svn@184 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
fgau 2008-10-02 13:34:27 +00:00
parent 7c540dd8ed
commit ed83245741
2 changed files with 14 additions and 0 deletions

View file

@ -119,6 +119,10 @@ class PyneoController(object):
# Register our own D-Bus callbacks
class_.gsm_wireless.connect_to_signal("Status", class_.on_gsm_wireless_status, dbus_interface=DIN_WIRELESS)
class_.pwr.connect_to_signal("Status", class_.on_pwr_status, dbus_interface=DIN_POWERED)
status = class_.pwr.GetStatus(dbus_interface=DIN_POWERED)
class_.on_pwr_status(status)
@classmethod
def power_status_gsm(class_):
@ -313,6 +317,12 @@ class PyneoController(object):
if status.has_key('fix'):
class_.notify_callbacks("gps_position_change", status)
@classmethod
def on_pwr_status(class_, status_map):
status = dedbusmap(status_map)
print "POWER Status: " + str(status)
class_.notify_callbacks("pwr_status_change", status)
@classmethod
def show_dialer_screen(class_):
class_.notify_callbacks("show_dialer_screen")

View file

@ -13,6 +13,10 @@ class GsmStatusScreen(EdjeGroup):
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("gsm_caption", "battvolt: %f<br>chgstate: %s"%(status['battvolt'], status['chgstate']))
def on_power_status_gsm(self, status):
if status: p_status = "on"