Skip to content

Commit

Permalink
adding b app: showing an alternative of you
Browse files Browse the repository at this point in the history
  • Loading branch information
mariobodemann committed Jul 1, 2024
1 parent 6d47cc2 commit ed223c5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
Binary file added zeassets/zeAlternativeBadge.bmp
Binary file not shown.
Binary file added zeassets/zeAlternativeBadge.xcf
Binary file not shown.
34 changes: 34 additions & 0 deletions zehardware/src/app_zealterego.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import displayio

import zeos
from message import Message
from ui import MessageKey as UIKeys


class ZeAlterEgoApp:
def __init__(self, os: zeos.ZeBadgeOs):
self.os = os
self.subscription_ids = []

def run(self):
self.subscription_ids += [
self.os.subscribe(
zeos.MessageKey.BUTTON_CHANGED,
lambda os, message: self._show()
),
]

self._show()

def unrun(self):
for subscription in self.subscription_ids:
self.os.unsubscribe(subscription)

def _show(self):
odb = displayio.OnDiskBitmap("zeAlternative.bmp")
self.os.messages.append(
Message(
UIKeys.SHOW_BITMAP,
(odb, odb.pixel_shader)
)
)
5 changes: 2 additions & 3 deletions zehardware/src/zeos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import ui
from app_developer_idle_clicker import DeveloperIdleClickerApp
from app_zepass import ZePassApp
from app_zealterego import ZeAlterEgoApp
from app_store_and_show import StoreAndShowApp
from config import fields_to_str
from config import load_config
Expand Down Expand Up @@ -191,15 +192,13 @@ def _init_interfaces(self):

def _init_apps(self):
self._app_a = StoreAndShowApp(self)
self._app_b = ZeAlterEgoApp(self)

if self.config["wifi.attached"]:
self._app_b = None
self._app_c = ZePassApp(self)
elif self.config['keyboard.attached']:
self._app_b = None
self._app_c = DeveloperIdleClickerApp(self)
else:
self._app_b = None
self._app_c = DeveloperIdleClickerApp(self)

self._start_app(self._app_a)
Expand Down

0 comments on commit ed223c5

Please sign in to comment.