This commit is contained in:
parent
9a1b401b4b
commit
d17a7770d6
3 changed files with 11 additions and 4 deletions
|
@ -17,7 +17,7 @@ LOG = logging.getLogger(__name__)
|
|||
def setup_animations(config, animator: BubaAnimator, webqueue: WebQueue):
|
||||
cs = BubaCharset(animator.buba)
|
||||
|
||||
bt = BubaTime(animator.buba)
|
||||
bt = BubaTime(animator.buba, config.ip)
|
||||
|
||||
snake = SnakeAnimation(animator.buba)
|
||||
|
||||
|
@ -46,7 +46,7 @@ def setup_animations(config, animator: BubaAnimator, webqueue: WebQueue):
|
|||
|
||||
# animator.add(cs)
|
||||
animator.add(bt)
|
||||
# animator.add(snake)
|
||||
animator.add(snake)
|
||||
animator.add(dbf_ahst)
|
||||
animator.add(dbf_ahs)
|
||||
animator.add(ccchh_events)
|
||||
|
|
|
@ -6,13 +6,14 @@ from buba.bubacmd import BubaCmd
|
|||
|
||||
|
||||
class BubaTime(BubaAnimation):
|
||||
def __init__(self, buba: BubaCmd):
|
||||
def __init__(self, buba: BubaCmd, ip:str):
|
||||
super().__init__(buba)
|
||||
self.ip = ip
|
||||
|
||||
def show(self):
|
||||
self.buba.text(page=0, row=0, col_start=0, col_end=119, text="Chaos Computer Club", align=BubaCmd.ALIGN_CENTER)
|
||||
self.buba.text(page=0, row=1, col_start=0, col_end=119, text="Hansestadt Hamburg", align=BubaCmd.ALIGN_CENTER)
|
||||
self.buba.text(page=0, row=2, col_start=0, col_end=119, text="", align=BubaCmd.ALIGN_CENTER)
|
||||
self.buba.text(page=0, row=2, col_start=0, col_end=119, text=f"{self.ip}", align=BubaCmd.ALIGN_CENTER)
|
||||
self.buba.text(page=0, row=3, col_start=0, col_end=119, text=datetime.now().strftime("%Y-%m-%d %H:%M"), align=BubaCmd.ALIGN_CENTER)
|
||||
|
||||
sleep(10)
|
||||
|
|
|
@ -22,3 +22,9 @@ class AppConfig:
|
|||
self.debug = True
|
||||
else:
|
||||
self.debug = False
|
||||
|
||||
import socket
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
s.connect(("8.8.8.8", 80))
|
||||
self.ip = s.getsockname()[0]
|
||||
s.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue