From 59761e5fcfeb0d6f37a51d9f441946e1110659e1 Mon Sep 17 00:00:00 2001 From: Dan Greco Date: Wed, 10 Mar 2021 17:18:16 -0500 Subject: [PATCH] Add vertical option --- dist/index.html | 3 ++- src/Components/Card/index.tsx | 21 ++++++++++++++++----- src/Components/Card/styles.ts | 3 --- src/Components/Stats/TimeStat.tsx | 17 ++++++++++++----- src/Components/Stats/index.tsx | 19 +++++++++++++------ src/Components/Stats/utils.tsx | 10 +++++++++- tsconfig.json | 3 ++- 7 files changed, 54 insertions(+), 22 deletions(-) diff --git a/dist/index.html b/dist/index.html index b7bc8f8..f91e5d8 100644 --- a/dist/index.html +++ b/dist/index.html @@ -63,11 +63,12 @@ type: 'custom:threedy-card', base_entity: 'sensor.ender_3_v2', name: "Ender 3 v2", - theme: "Default", + theme: "Neumorphic", scale: 1, temperature_unit: 'C', printer_type: 'I3', round_temperature: false, + vertical: true, use_24hr: true, light_entity: 'switch.light', camera_entity: "camera.test", diff --git a/src/Components/Card/index.tsx b/src/Components/Card/index.tsx index 4b008d8..020225d 100644 --- a/src/Components/Card/index.tsx +++ b/src/Components/Card/index.tsx @@ -11,6 +11,7 @@ import Stats from '../Stats'; import styles from './styles'; import Camera from "../Camera"; +import {percentComplete} from "../Stats/utils"; const Card = ({ }) => { @@ -39,6 +40,9 @@ const Card = ({ }) => { const theme = config.theme || 'Default'; + const vertical = config.vertical; + const round = config.round; + const percent = percentComplete(hass, config); const borderRadius = styles[theme] ? styles[theme].borderRadius : styles['Default'].borderRadius; @@ -131,24 +135,31 @@ const Card = ({ }) => {