This commit is contained in:
dadav 2019-10-06 19:59:03 +02:00
parent fae6115e44
commit b4d7ea7dbf

View File

@ -8,6 +8,7 @@ sys.path.insert(0,
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.join(os.path.dirname(os.path.realpath(__file__)),
'../')) '../'))
import pwnagotchi.ui.faces as faces
from pwnagotchi.ui.display import Display, VideoHandler from pwnagotchi.ui.display import Display, VideoHandler
from PIL import Image from PIL import Image
@ -33,10 +34,26 @@ class CustomDisplay(Display):
class DummyPeer: class DummyPeer:
def __init__(self):
self.rssi = -50
@staticmethod @staticmethod
def name(): def name():
return "beta" return "beta"
@staticmethod
def pwnd_run():
return 50
@staticmethod
def pwnd_total():
return 100
@staticmethod
def face():
return faces.FRIEND
def append_images(images, horizontal=True, xmargin=0, ymargin=0): def append_images(images, horizontal=True, xmargin=0, ymargin=0):
w, h = zip(*(i.size for i in images)) w, h = zip(*(i.size for i in images))
@ -71,8 +88,9 @@ def main():
parser.add_argument('--lang', help="Language to use", parser.add_argument('--lang', help="Language to use",
default="en") default="en")
parser.add_argument('--output', help="Path to output image (PNG)", default="preview.png") parser.add_argument('--output', help="Path to output image (PNG)", default="preview.png")
parser.add_argument('--xmargin', type=int, default=5) parser.add_argument('--show-peer', dest="showpeer", help="This options will show a dummy peer", action="store_true")
parser.add_argument('--ymargin', type=int, default=5) parser.add_argument('--xmargin', help="Add X-Margin", type=int, default=5)
parser.add_argument('--ymargin', help="Add Y-Margin", type=int, default=5)
args = parser.parse_args() args = parser.parse_args()
config_template = ''' config_template = '''
@ -103,7 +121,8 @@ def main():
for display in list_of_displays: for display in list_of_displays:
emotions = list() emotions = list()
# Starting if args.showpeer:
display.set_closest_peer(DummyPeer())
display.on_starting() display.on_starting()
display.update() display.update()
emotions.append(display.get_image()) emotions.append(display.get_image())