Skip to content

Commit f0fcbfb

Browse files
committed
New features
1 parent 37209cd commit f0fcbfb

File tree

2 files changed

+218
-126
lines changed

2 files changed

+218
-126
lines changed

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
# Lovelace Analog Clock
33
An analog clock card for Home Assistant Lovelace. Colors are fully customizable, weekday names and date formats are localizable.
44

5+
In addition to the js file is moment.js needed, but only if you plan to use dateformat or timeformat. To install moment.js add these lines in the section 'resources' in ui-lovelace.yaml:
6+
```
7+
- url: https://unpkg.com/moment@2.29.1/min/moment-with-locales.js
8+
type: module
9+
```
10+
11+
If you use the dateformat or timeformat and the hands are not shown, that probably means moment.js is not properly loaded.
12+
13+
For a list of available options for dateformat and timeformat, see this:
14+
https://momentjs.com/docs/#/displaying/format/
515

616
![Analog clock2](https://github.com/tomasrudh/analogclock/blob/main/Images/AnalogClock2.png?raw=true)
717

@@ -10,6 +20,7 @@ An analog clock card for Home Assistant Lovelace. Colors are fully customizable,
1020
| locale | String | HA setting | Locale for date and week day |
1121
| timezone | String | Browser setting | Time zone, for example Europe/Stockholm |
1222
| show_timezone | Boolean | false | If true, show time zone instead of week day |
23+
| timezonedisplayname | String | | Name of the time zone to be shown |
1324
| diameter | Integer | Automatic | Diameter of the clock |
1425
| hide_secondhand | Boolean | false | If true, the second hand is hidden |
1526
| hide_weeknumber | Boolean | true | If true, the week number is hidden NOTE: default has changed to true |
@@ -19,6 +30,7 @@ An analog clock card for Home Assistant Lovelace. Colors are fully customizable,
1930
| hide_digitaltime | Boolean | false | If true, the digital time hidden |
2031
| color_background | String | primary background color | Background color of the clock |
2132
| color_ticks | String | Silver | Color of the border ticks |
33+
| hide_minorticks | Boolean | false | Hides the minor ticks |
2234
| color_facedigits | String | Silver | Color of the borde digits |
2335
| color_digitaltime | String | #CCCCCC | Color of the digital time |
2436
| color_hourhand | String | #CCCCCC | Color of the hour hand |
@@ -28,6 +40,10 @@ An analog clock card for Home Assistant Lovelace. Colors are fully customizable,
2840
| style_hourhand | Integer | 1 | Style for the hour hand |
2941
| style_minutehand | Integer | 1 | Style for the minute hand |
3042
| style_secondhand | Integer | 3 | Style for the second hand |
43+
| dateformat | String | HA setting | Format for the date (Require moment.js) |
44+
| timeformat | String | HA setting | Format for the time (Require moment.js) |
45+
46+
Themes are settings that are applied during a time interval. Any setting except timezone and diameter can be set in themes. There can be multiple 'time' sections.
3147

3248
| Name | Type | Description
3349
| --- | --- | --- |
@@ -51,6 +67,21 @@ An analog clock card for Home Assistant Lovelace. Colors are fully customizable,
5167
- time: 23:00-08:00
5268
color_background: maroon
5369
```
70+
![Analog clock4](https://github.com/tomasrudh/analogclock/blob/main/Images/AnalogClock4.png?raw=true)
71+
```
72+
- type: "custom:analog-clock"
73+
hide_SecondHand: true
74+
color_HourHand: "#326ba8"
75+
color_MinuteHand: "#3273a8"
76+
color_DigitalTime: "#CCCCCC"
77+
color_FaceDigits: "#a83832"
78+
hide_minorticks: true
79+
timezone: America/Fortaleza
80+
timezonedisplayname: "UTC-3"
81+
dateformat: "MMM Do YYYY"
82+
timeformat: "hh mm"
83+
```
84+
5485
Style 1:
5586
![Style 1](https://github.com/tomasrudh/analogclock/blob/main/Images/Style-1.png?raw=true)
5687
Style 2:

0 commit comments

Comments
 (0)