Ejemplo n.º 1
0
    def __init__(self):
        self.app = None

        self.bar = widgets.StatusBar()

        self.quick_ring = []
        self.launcher = LauncherApp()
        self.launcher_ring = []
        self.notifier = NotificationApp()
        self.notifications = {}
        self.musicstate = {}
        self.musicinfo = {}

        self.blank_after = 15

        self._alarms = []
        self._brightness = 2
        self._button = PinHandler(watch.button)
        self._charging = True
        self._scheduled = False
        self._scheduling = False

        # TODO: Eventually these should move to main.py
        for app, qr in ((ClockApp, True), (StepCounterApp, True),
                        (StopwatchApp, True), (HeartApp, True),
                        (FlashlightApp, False), (SettingsApp, False), (TestApp,
                                                                       False)):
            try:
                self.register(app(), qr)
            except:
                # Let's not bring the whole device down just because there's
                # an exception starting one of the apps...
                pass
Ejemplo n.º 2
0
    def __init__(self):
        self.app = None

        self.quick_ring = []
        self.launcher = LauncherApp()
        self.launcher_ring = []
        self.notifier = NotificationApp()
        self.notifications = {}

        self.blank_after = 15

        self._brightness = 2
        self._button = PinHandler(watch.button)
        self._charging = True
        self._scheduled = False
        self._scheduling = False

        # TODO: Eventually these should move to main.py
        self.register(ClockApp(), True)
        self.register(StepCounterApp(), True)
        self.register(StopwatchApp(), True)
        self.register(HeartApp(), True)
        self.register(FlashlightApp(), False)
        self.register(SettingsApp(), False)
        self.register(TestApp(), False)
Ejemplo n.º 3
0
    def __init__(self):
        self.app = None

        self.bar = widgets.StatusBar()

        self.quick_ring = []
        self.launcher = LauncherApp()
        self.launcher_ring = []
        self.notifier = NotificationApp()
        self.notifications = {}
        self.musicstate = {}
        self.musicinfo = {}
        self.call = PhoneApp()
        self.phonestate = {}

        self._theme = (
            b'\x7b\xef'  # ble
            b'\x7b\xef'  # scroll-indicator
            b'\x7b\xef'  # battery
            b'\xe7\x3c'  # status-clock
            b'\x7b\xef'  # notify-icon
            b'\xff\xff'  # bright
            b'\xbd\xb6'  # mid
            b'\x39\xff'  # ui
            b'\xff\x00'  # spot1
            b'\xdd\xd0'  # spot2
            b'\x00\x0f'  # contrast
        )

        self.blank_after = 15

        self._alarms = []
        self._brightness = 2
        self._notifylevel = 2
        if 'P8' in watch.os.uname().machine:
            self._nfylevels = [0, 225, 450]
        else:
            self._nfylevels = [0, 40, 80]
        self._nfylev_ms = self._nfylevels[self._notifylevel - 1]
        self._button = PinHandler(watch.button)
        self._charging = True
        self._scheduled = False
        self._scheduling = False

        # TODO: Eventually these should move to main.py
        for app, qr in ((ClockApp, True), (StepCounterApp, True),
                        (StopwatchApp, True), (HeartApp, True),
                        (SoftwareApp, False), (SettingsApp, False)):
            try:
                a = app()

                # Special case for watches with working step counters!
                if isinstance(a, StepCounterApp):
                    self.steps = steplogger.StepLogger(self)

                self.register(a, qr)
            except:
                # Let's not bring the whole device down just because there's
                # an exception starting one of the apps...
                pass
Ejemplo n.º 4
0
    def __init__(self):
        self.app = None

        self.quick_ring = []
        self.launcher = LauncherApp()
        self.launcher_ring = []
        self.notifier = NotificationApp()
        self.notifications = {}

        self.blank_after = 15

        self._brightness = 2
        self._button = PinHandler(watch.button)
        self._charging = True
        self._scheduled = False
        self._scheduling = False

        # TODO: Eventually these should move to main.py
        for app, qr in ((ClockApp, True)):
            try:
                self.register(app(), qr)
            except:
                # Let's not bring the whole device down just because there's
                # an exception starting one of the apps...
                pass
Ejemplo n.º 5
0
    def __init__(self):
        self.app = None

        self.bar = widgets.StatusBar()

        self.quick_ring = []
        self.launcher = LauncherApp()
        self.launcher_ring = []
        self.notifier = NotificationApp()
        self.notifications = {}
        self.musicstate = {}
        self.musicinfo = {}

        self._theme = (
            b'\x7b\xef'  # ble
            b'\x7b\xef'  # scroll-indicator
            b'\x7b\xef'  # battery
            b'\xe7\x3c'  # status-clock
            b'\x7b\xef'  # notify-icon
            b'\xb5\xb6'  # accent-mid
            b'\xbd\xb6'  # accent-lo
            b'\xff\xff'  # accent-hi
            b'\x39\xff'  # slider-default
        )

        self.blank_after = 15

        self._alarms = []
        self._brightness = 2
        self._notifylevel = 2
        if 'P8' in watch.os.uname().machine:
            self._nfylevels = [0, 225, 450]
        else:
            self._nfylevels = [0, 40, 80]
        self._nfylev_ms = self._nfylevels[self._notifylevel - 1]
        self._button = PinHandler(watch.button)
        self._charging = True
        self._scheduled = False
        self._scheduling = False

        # TODO: Eventually these should move to main.py
        for app, qr in ((ClockApp, True), (StepCounterApp, True),
                        (StopwatchApp, True), (HeartApp, True),
                        (FlashlightApp, False), (SettingsApp, False), (TestApp,
                                                                       False)):
            try:
                self.register(app(), qr)
            except:
                # Let's not bring the whole device down just because there's
                # an exception starting one of the apps...
                pass
Ejemplo n.º 6
0
    def __init__(self):
        self.app = None

        self.bar = widgets.StatusBar()

        self.quick_ring = []
        self.launcher = LauncherApp()
        self.launcher_ring = []
        self.notifier = NotificationApp()
        self.notifications = {}
        self.musicstate = {}
        self.musicinfo = {}
        self.weatherinfo = {}
        self.units = "Metric"

        self._theme = (
            b'\x7b\xef'  # ble
            b'\x7b\xef'  # scroll-indicator
            b'\x7b\xef'  # battery
            b'\xe7\x3c'  # status-clock
            b'\x7b\xef'  # notify-icon
            b'\xff\xff'  # bright
            b'\xbd\xb6'  # mid
            b'\x39\xff'  # ui
            b'\xff\x00'  # spot1
            b'\xdd\xd0'  # spot2
            b'\x00\x0f'  # contrast
        )

        self.blank_after = 15

        self._alarms = []
        self._brightness = 2
        self._notifylevel = 2
        if 'P8' in watch.os.uname().machine:
            self._nfylevels = [0, 225, 450]
        else:
            self._nfylevels = [0, 40, 80]
        self._nfylev_ms = self._nfylevels[self._notifylevel - 1]
        self._button = PinHandler(watch.button)
        self._charging = True
        self._scheduled = False
        self._scheduling = False