Added waveshare27inch as a known display

Signed-off-by: Mike van der Vrugt <mimij68@live.nl>
This commit is contained in:
SpiderDead 2019-10-20 21:27:10 +02:00
parent 376a74d7ac
commit 3c97dbf8dc
3 changed files with 10 additions and 0 deletions

@ -29,6 +29,9 @@ class Display(View):
def is_waveshare_v2(self): def is_waveshare_v2(self):
return self._implementation.name == 'waveshare_2' return self._implementation.name == 'waveshare_2'
def is_waveshare27inch(self):
return self._implementation.name == 'waveshare27inch'
def is_oledhat(self): def is_oledhat(self):
return self._implementation.name == 'oledhat' return self._implementation.name == 'oledhat'

@ -4,6 +4,7 @@ from pwnagotchi.ui.hw.oledhat import OledHat
from pwnagotchi.ui.hw.lcdhat import LcdHat from pwnagotchi.ui.hw.lcdhat import LcdHat
from pwnagotchi.ui.hw.waveshare1 import WaveshareV1 from pwnagotchi.ui.hw.waveshare1 import WaveshareV1
from pwnagotchi.ui.hw.waveshare2 import WaveshareV2 from pwnagotchi.ui.hw.waveshare2 import WaveshareV2
from pwnagotchi.ui.hw.waveshare27inch import Waveshare27inch
def display_for(config): def display_for(config):
@ -26,3 +27,6 @@ def display_for(config):
elif config['ui']['display']['type'] == 'waveshare_2': elif config['ui']['display']['type'] == 'waveshare_2':
return WaveshareV2(config) return WaveshareV2(config)
elif config['ui']['display']['type'] == 'waveshare27inch':
return Waveshare27inch(config)

@ -82,6 +82,9 @@ def load_config(args):
elif config['ui']['display']['type'] in ('ws_2', 'ws2', 'waveshare_2', 'waveshare2'): elif config['ui']['display']['type'] in ('ws_2', 'ws2', 'waveshare_2', 'waveshare2'):
config['ui']['display']['type'] = 'waveshare_2' config['ui']['display']['type'] = 'waveshare_2'
elif config['ui']['display']['type'] in ('ws_27inch', 'ws27inch', 'waveshare_27inch', 'waveshare27inch'):
config['ui']['display']['type'] = 'waveshare27inch'
else: else:
print("unsupported display type %s" % config['ui']['display']['type']) print("unsupported display type %s" % config['ui']['display']['type'])
exit(1) exit(1)