From 3c97dbf8dc630cdc534c392581e6973b1c7f5b66 Mon Sep 17 00:00:00 2001
From: SpiderDead <mimij68@live.nl>
Date: Sun, 20 Oct 2019 21:27:10 +0200
Subject: [PATCH] Added waveshare27inch as a known display Signed-off-by: Mike
 van der Vrugt <mimij68@live.nl>

---
 pwnagotchi/ui/display.py     | 3 +++
 pwnagotchi/ui/hw/__init__.py | 4 ++++
 pwnagotchi/utils.py          | 3 +++
 3 files changed, 10 insertions(+)

diff --git a/pwnagotchi/ui/display.py b/pwnagotchi/ui/display.py
index eac519f..c4fd495 100644
--- a/pwnagotchi/ui/display.py
+++ b/pwnagotchi/ui/display.py
@@ -29,6 +29,9 @@ class Display(View):
     def is_waveshare_v2(self):
         return self._implementation.name == 'waveshare_2'
 
+    def is_waveshare27inch(self):
+        return self._implementation.name == 'waveshare27inch'
+
     def is_oledhat(self):
         return self._implementation.name == 'oledhat'
 
diff --git a/pwnagotchi/ui/hw/__init__.py b/pwnagotchi/ui/hw/__init__.py
index ee00a73..1e0bf31 100644
--- a/pwnagotchi/ui/hw/__init__.py
+++ b/pwnagotchi/ui/hw/__init__.py
@@ -4,6 +4,7 @@ from pwnagotchi.ui.hw.oledhat import OledHat
 from pwnagotchi.ui.hw.lcdhat import LcdHat
 from pwnagotchi.ui.hw.waveshare1 import WaveshareV1
 from pwnagotchi.ui.hw.waveshare2 import WaveshareV2
+from pwnagotchi.ui.hw.waveshare27inch import Waveshare27inch
 
 
 def display_for(config):
@@ -26,3 +27,6 @@ def display_for(config):
 
     elif config['ui']['display']['type'] == 'waveshare_2':
         return WaveshareV2(config)
+
+    elif config['ui']['display']['type'] == 'waveshare27inch':
+        return Waveshare27inch(config)
\ No newline at end of file
diff --git a/pwnagotchi/utils.py b/pwnagotchi/utils.py
index 419d80d..f431680 100644
--- a/pwnagotchi/utils.py
+++ b/pwnagotchi/utils.py
@@ -82,6 +82,9 @@ def load_config(args):
     elif config['ui']['display']['type'] in ('ws_2', 'ws2', 'waveshare_2', 'waveshare2'):
         config['ui']['display']['type'] = 'waveshare_2'
 
+    elif config['ui']['display']['type'] in ('ws_27inch', 'ws27inch', 'waveshare_27inch', 'waveshare27inch'):
+        config['ui']['display']['type'] = 'waveshare27inch'
+
     else:
         print("unsupported display type %s" % config['ui']['display']['type'])
         exit(1)