From 9d887930da4cf327d168139715e94586d84853ca Mon Sep 17 00:00:00 2001
From: Remy Moll <mollator2@gmail.com>
Date: Fri, 6 Nov 2020 20:28:51 +0100
Subject: [PATCH] fixing weather?

---
 clock/api/hat/unicorn.py  |  6 ++----
 clock/api/led.py          |  8 ++++----
 clock/main.py             |  1 +
 dashboard/main.py         | 22 ++++++++++------------
 dashboard/static/test.css |  2 +-
 5 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/clock/api/hat/unicorn.py b/clock/api/hat/unicorn.py
index f5f856a..cf0dddf 100644
--- a/clock/api/hat/unicorn.py
+++ b/clock/api/hat/unicorn.py
@@ -56,6 +56,7 @@ class UnicornHat(object):
             GPIO.output(self.PINS_DAT[0], b1 & 0b10000000)
             GPIO.output(self.PINS_DAT[1], b2 & 0b10000000)
             GPIO.output(self.PIN_CLK, GPIO.HIGH)
+
             b1 <<= 1
             b2 <<= 1
             #time.sleep(0.00000001)
@@ -83,21 +84,19 @@ class UnicornHat(object):
     def set_pixel(self, x, y, r, g, b):
         """Set a single pixel to RGB colour.
         :param x: Horizontal position from 0 to width
-        :param y: Veritcal position from 0 to height
+        :param y: Vertical position from 0 to height
         :param r: Amount of red from 0 to 255
         :param g: Amount of green from 0 to 255
         :param b: Amount of blue from 0 to 255
         """
         self.buffer[y][x] = r, g, b
 
-
     def set_matrix(self, matrix):
         """Sets a height x width matrix directly"""
         self.reset_clock()
         self.buffer = matrix
         self.show()
 
-
     def set_pixel_hsv(self, x, y, h, s=1.0, v=1.0):
         """set a single pixel to a colour using HSV.
          :param x: Horizontal position from 0 to 15
@@ -124,7 +123,6 @@ class UnicornHat(object):
 
     def get_shape(self):
         """Return the shape (width, height) of the display."""
-
         return self.WIDTH, self.HEIGHT
 
     def clear(self):
diff --git a/clock/api/led.py b/clock/api/led.py
index ad20822..f55f1e8 100644
--- a/clock/api/led.py
+++ b/clock/api/led.py
@@ -11,14 +11,14 @@ except ImportError:
 
 
 class OutputHandler():
-    def __init__(self, width, height):
+    def __init__(self, width, height, primary = [200, 200, 200], secondary = [10, 200, 10], error = [200, 10, 10]):
         """width is presumed to be larger than height"""
         self.width = width
         self.height = height
         self.output = HAT.UnicornHat(width, height)
-        self.primary = [200, 200, 200]
-        self.secondary = [10, 200, 10]
-        self.red = [200, 10, 10]
+        self.primary = primary
+        self.secondary = secondary
+        self.red = error
 
 
 
diff --git a/clock/main.py b/clock/main.py
index e134e42..336f060 100644
--- a/clock/main.py
+++ b/clock/main.py
@@ -53,6 +53,7 @@ class ClockFace(object):
     def set_face(self, weather):
         """"""
         self.weather = weather
+        print("WEATHER: ", weather)
         self.run(self.IO.clock_face,(weather,))
 
 
diff --git a/dashboard/main.py b/dashboard/main.py
index ebfeacc..b48515a 100644
--- a/dashboard/main.py
+++ b/dashboard/main.py
@@ -10,8 +10,8 @@ app = dash.Dash(__name__, external_stylesheets=ex_css)
 
 card_main = dbc.Card(
     [
-        dbc.CardImg(src="/assets/ball_of_sun.jpg", top=True, bottom=False,
-                    title="Image by Kevin Dinkel", alt='Learn Dash Bootstrap Card Component'),
+        #dbc.CardImg(src="/assets/ball_of_sun.jpg", top=True, bottom=False,
+        #            title="Image by Kevin Dinkel", alt='Learn Dash Bootstrap Card Component'),
         dbc.CardBody(
             [
                 html.H4("Learn Dash with Charming Data", className="card-title"),
@@ -47,9 +47,6 @@ card_question = dbc.Card(
 )
 
 
-
-
-
 today = datetime.date.today().strftime("%d.%m.%Y")
 tag = ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"][datetime.datetime.today().weekday()]
 
@@ -59,24 +56,24 @@ string_header = tag + ", der " + today
 app.layout = html.Div([
     html.Header(children = [
         html.H1(string_header)
-    ]),
+    ],),
     html.Div(
         className = "content",
         style = {"padding-top" : "32em"},
         children = [
-            dbc.Row([dbc.Col(card_main, width=3),
-                     dbc.Col(card_question, width=3)], justify="around"),  # justify="start", "center", "end", "between", "around"
+            # dbc.Row([dbc.Col(card_main, width=3),
+            #         dbc.Col(card_question, width=3)], justify="around"),  # justify="start", "center", "end", "between", "around"
 
             # dbc.CardGroup([card_main, card_question, card_graph])   # attaches cards with equal width and height columns
             # dbc.CardDeck([card_main, card_question, card_graph])    # same as CardGroup but with gutter in between cards
 
-            # dbc.CardColumns([                        # Cards organised into Masonry-like columns
-            #         card_main,
-            #         card_question,
+            dbc.CardColumns([                        # Cards organised into Masonry-like columns
+                    card_main,
+                    card_question,card_question,card_question,card_question,
             #         card_graph,
             #         card_question,
             #         card_question,
-            # ])
+            ])
     ])
 ])
 
@@ -85,3 +82,4 @@ app.layout = html.Div([
 
 if __name__ == "__main__":
     app.run_server(host="0.0.0.0")
+5
diff --git a/dashboard/static/test.css b/dashboard/static/test.css
index b5c2706..d154e16 100644
--- a/dashboard/static/test.css
+++ b/dashboard/static/test.css
@@ -1,4 +1,4 @@
-header {
+div.header {
 	position: fixed;
 	width: 100%;
 	height: var(--heading-height);