From 2a0bf3359a5c81ab38f9580aa251c86a7bdc04ff Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Fri, 7 Jan 2022 00:00:47 +0100 Subject: [PATCH] Emojis -> icons, Arial -> Roboto and autorefresh on clients --- .drone.yml | 29 +++++++++++++++++++++++++++-- src/components/PlantState.tsx | 8 +++++--- src/lib/types.d.ts | 5 +++++ src/styles/global.css | 4 +++- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index af3bf65..a2a0b47 100644 --- a/.drone.yml +++ b/.drone.yml @@ -72,8 +72,33 @@ steps: from_secret: registry_host IMAGE: infoscreen:latest commands: - #- docker login -u $${DOCKER_USER} -p $${DOCKER_PASS} - docker-compose -p infoscreen -f docker-compose.yml rm -s -v -f - docker rmi $${REGISTRY_HOST}/$${IMAGE} || true - docker pull $${REGISTRY_HOST}/$${IMAGE} - - docker-compose -p infoscreen -f docker-compose.yml up --no-build -d \ No newline at end of file + - docker-compose -p infoscreen -f docker-compose.yml up --no-build -d +--- +kind: pipeline +type: ssh +name: refresh-client +depends_on: +- deploy +trigger: + branch: + - senpai + event: + - push +server: + host: + from_secret: ssh_client_host + user: + from_secret: ssh_client_user + ssh_key: + from_secret: ssh_key +steps: +- name: deploy + when: + branch: + - senpai + commands: + - export DISPLAY=:0 + - xdotool search --onlyvisible --class "chromium-browser" key F5 \ No newline at end of file diff --git a/src/components/PlantState.tsx b/src/components/PlantState.tsx index 11711d8..ab4b9e8 100644 --- a/src/components/PlantState.tsx +++ b/src/components/PlantState.tsx @@ -1,6 +1,8 @@ import * as React from "react" import { PlantState as PlantStateType } from "../lib/interfaces"; -import * as styles from "../styles/containers/PlantState.module.css" +import * as styles from "../styles/containers/PlantState.module.css"; +import WaterDrops from "../images/weather-icons/svg/wi-raindrops.svg"; +import Dust from "../images/weather-icons/svg/wi-dust.svg"; const PLANT_REFRESH_INTERVAL = 15 * 60 * 1000; @@ -37,11 +39,11 @@ const PlantState = ({ hassUrl, token, plants }: { hassUrl: string, token: string return
{key}
- 💧
+
{plantStates[key].moisture === "unavailable" ? "?" : plantStates[key].moisture} {plantStates[key].unit_of_measurement_dict.moisture}
- 🪴
+
{plantStates[key].conductivity === "unavailable" ? "?" : plantStates[key].conductivity} {plantStates[key].unit_of_measurement_dict.conductivity}
diff --git a/src/lib/types.d.ts b/src/lib/types.d.ts index b4d8ff6..06ddbcf 100644 --- a/src/lib/types.d.ts +++ b/src/lib/types.d.ts @@ -6,4 +6,9 @@ declare module '*.css' { declare module '*.gif' { const path: string; export = path; +} + +declare module "*.svg" { + const content: any; + export default content; } \ No newline at end of file diff --git a/src/styles/global.css b/src/styles/global.css index 32cef8d..e9b5dfb 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -1,3 +1,5 @@ +@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap'); + * { box-sizing: border-box; } @@ -37,7 +39,7 @@ main { align-items: stretch; justify-content: stretch; max-width: 100%; - font-family: Arial; + font-family: "Roboto"; transition: background-image 1s linear; background-repeat: no-repeat; background-size: cover;