Skip to content

Commit 3e20104

Browse files
authored
Merge pull request #237 from marksie1988/v2.0.0
v2.0.0
2 parents 32b8556 + 37c1ddb commit 3e20104

28 files changed

+10832
-6189
lines changed

.devcontainer/devcontainer.json

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
{
2-
"name": "Atomic Calendar Revive",
3-
"dockerFile": "Dockerfile",
4-
"context": "..",
5-
"appPorts": [5000],
6-
"postCreateCommand": "npm install",
7-
"workspaceFolder": "/atomic-calendar-revive",
8-
"workspaceMount": "type=bind,source=/home/stev2673/repos/atomic-calendar-revive,target=/atomic-calendar-revive",
9-
"extensions": [
10-
"github.vscode-pull-request-github",
11-
"esbenp.prettier-vscode",
12-
"yzhang.markdown-all-in-one",
13-
"bierner.lit-html",
14-
"runem.lit-plugin",
15-
"davidanson.vscode-markdownlint",
16-
"redhat.vscode-yaml"
17-
],
18-
"settings": {
19-
"files.eol": "\n",
20-
"editor.tabSize": 2,
21-
"terminal.integrated.shell.linux": "/bin/zsh",
22-
"editor.formatOnPaste": false,
23-
"editor.formatOnSave": true,
24-
"editor.formatOnType": true,
25-
"files.trimTrailingWhitespace": true
26-
}
2+
"name": "Atomic Calendar Revive",
3+
"dockerFile": "Dockerfile",
4+
"context": "..",
5+
"appPorts": [5000],
6+
"postCreateCommand": "npm install",
7+
"workspaceFolder": "/atomic-calendar-revive",
8+
"workspaceMount": "type=bind,source=/home/stev2673/repos/atomic-calendar-revive,target=/atomic-calendar-revive",
9+
"extensions": [
10+
"github.vscode-pull-request-github",
11+
"esbenp.prettier-vscode",
12+
"yzhang.markdown-all-in-one",
13+
"bierner.lit-html",
14+
"runem.lit-plugin",
15+
"davidanson.vscode-markdownlint",
16+
"redhat.vscode-yaml",
17+
"eamodio.gitlens"
18+
],
19+
"settings": {
20+
"files.eol": "\n",
21+
"editor.tabSize": 2,
22+
"terminal.integrated.shell.linux": "/bin/zsh",
23+
"editor.formatOnPaste": false,
24+
"editor.formatOnSave": true,
25+
"editor.formatOnType": true,
26+
"files.trimTrailingWhitespace": true
27+
}
2728
}

.eslintrc.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
module.exports = {
2-
"env": {
3-
"browser": true,
4-
"es6": true
2+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
extends: [
4+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
5+
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
6+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
7+
],
8+
parserOptions: {
9+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
10+
sourceType: 'module', // Allows for the use of imports
11+
experimentalDecorators: true,
512
},
6-
"extends": "eslint:recommended",
7-
"globals": {
8-
"Atomics": "readonly",
9-
"SharedArrayBuffer": "readonly"
10-
},
11-
"parserOptions": {
12-
"ecmaVersion": 2020,
13-
"sourceType": "module"
14-
},
15-
"rules": {
13+
rules: {
14+
"@typescript-eslint/camelcase": 0
1615
}
1716
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
dist/app*.js
2+
dist/index.js
23

34
# Logs
45
logs

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
semi: true,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
printWidth: 120,
6+
useTabs: true,
7+
tabWidth: 2
8+
}

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
# BREAKING CHANGES WITH v2.0.0
2+
3+
Please be aware that if you are upgrading form a version prior to 2.0.0 you will most likely need to update your configuration
4+
15
# Atomic Calendar Revive
6+
27
An advanced calendar card for Home Assistant with Lovelace. (fixed to work with HA v106+)
38

49
**If you already have Atomic Calendar Revive installed, please check the Releases Change Log before upgrading, there have been some breaking changes since I took on this development.**
@@ -34,6 +39,7 @@ It loads calendar events from Home Assistant - Google calendar component.
3439
It contains two types of views: `Events mode` and `Calendar mode`. You can switch or select the default one.
3540

3641
New features that are only in Revive:
42+
3743
- Added more appealing UI Look
3844
- Added the ability to display calendar names
3945
- Added keyword whitelists
@@ -45,21 +51,24 @@ New features that are only in Revive:
4551
- Multiple Bug Fixes
4652

4753
The most important features:
54+
4855
- No need to load external libraries (everything is included)
4956
- Custom colors and settings for different calendars, custom font sizes, colors of every text and line
5057
- All translations included, few of the words can be configured in settings
5158
- Compatible with all day and multiple day events
5259
- Fast switch between both modes, or make one of them default
5360

5461
* Event mode:
62+
5563
- Shows nearest events, one by one, day by day, time of events in a different way (dates, hours)
5664
- Moves today's completed events up and dim them
5765
- Highlights the next event, or show a progress bar
5866
- Shows event location link
5967
- Clicking on the event title will open a new window with Google Calendar (can be disabled)
60-
- Clicking on Location will open a window with this location on Google Maps (can be disabled)
68+
- Clicking on Location will open a window with this location on Google Maps (can be disabled)
6169

6270
* Calendar mode:
71+
6372
- Show a traditional calendar (a table with 42 days) with configurable events icons like holiday, birthday
6473
- Quick overview of the following months
6574
- You can set keywords to show only important things, like birthday

dist/atomic-calendar-revive.js

Lines changed: 190 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/config/advanced_config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ nav_order: 3
1414
name: "Calendar"
1515
entities:
1616
- entity: calendar.YOUR_CALENDARS_HERE
17+
startTimeFilter: '10:00'
18+
endTimeFilter: '17:00'
1719
fullDayEventText: "All day"
1820
untilText: "Until"
1921
showColors: true

docs/config/basic_config.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ nav_order: 1
1010
This example is the most basic implementation, it will just show you a list of events
1111

1212
```yaml
13-
- type: "custom:atomic-calendar-revive"
13+
- type: 'custom:atomic-calendar-revive'
1414
entities:
1515
- entity: calendar.YOUR_CALENDAR_HERE
1616
```
@@ -20,8 +20,8 @@ This example is the most basic implementation, it will just show you a list of e
2020
## With Name
2121
2222
```yaml
23-
- type: "custom:atomic-calendar-revive"
24-
name: "My Calendar"
23+
- type: 'custom:atomic-calendar-revive'
24+
name: 'My Calendar'
2525
entities:
2626
- entity: calendar.YOUR_CALENDAR_HERE
2727
```
@@ -31,18 +31,17 @@ This example is the most basic implementation, it will just show you a list of e
3131
## With Calendar Mode Enabled
3232
3333
```yaml
34-
- type: "custom:atomic-calendar-revive"
35-
name: "My Calendar"
34+
- type: 'custom:atomic-calendar-revive'
35+
name: 'My Calendar'
3636
entities:
3737
- entity: calendar.YOUR_CALENDAR_HERE
38-
type: icon1
39-
color: green
38+
icon: 'mdi:home-heart'
39+
color: 'red'
4040
- entity: calendar.YOUR_CALENDAR1_HERE
41-
type: icon2
42-
color: red
41+
icon: 'mdi:account-plus'
42+
color: 'blue'
4343
- entity: calendar.YOUR_CALENDAR2_HERE
44-
type: holiday
45-
color: blue
44+
icon: 'mdi:account'
4645
enableModeChange: true
4746
```
4847
@@ -51,17 +50,17 @@ This example is the most basic implementation, it will just show you a list of e
5150
### With both Events mode and Calendar mode, calendar is default
5251
5352
```yaml
54-
- type: "custom:atomic-calendar-revive"
55-
name: "Calendar"
53+
- type: 'custom:atomic-calendar-revive'
54+
name: 'Calendar'
5655
enableModeChange: true
57-
defaultMode: 2
58-
calEventIcon1Filter: birthday
59-
calEventIcon2Filter: waste,bills
56+
defaultMode: Calendar
6057
entities:
6158
- entity: calendar.YOUR_CALENDAR_HERE
62-
type: icon2
59+
icon: 'mdi:home-heart'
60+
color: 'red'
6361
- entity: calendar.YOUR_CALENDAR1_HERE
64-
type: icon1,icon2
62+
icon: 'mdi:account-plus'
63+
color: 'blue'
6564
- entity: calendar.YOUR_CALENDAR2_HERE
66-
type: holiday
65+
icon: 'mdi:account'
6766
```

docs/config/calendar_mode.md

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,21 @@ The second mode of view - calendar mode - Shows the full month calendar with sim
1111
You can change the mode by clicking the card name, or even make it the default view.
1212
To make it work correctly you need to get more events than default 5 - you need to follow instruction [here](/quickstart#Show-more-than-5-events) for this, and setup it for 20-30 events at least.
1313

14-
There are four configurable possibilities for showing events occurring any day:
14+
Any events that you want to have displayed on the calendar you should assign an icon, optionally you can set a color which will display this in a different color.
1515

16-
- day number color - for example "14" will be red for Valentine's Day
17-
- Icon1 - will show any mdi icon under date, like birthday (default: gift icon)
18-
- Icon2 - like above, just any other type of event (default: home icon)
19-
- Icon3 - like above (default: star icon)
16+
If you want to have multiple icons for a calendar simply duplicate the entity and have different whitelists
2017

2118
If you want to use any calendar's events, you have to add one or more of types:
2219

2320
```yaml
24-
calEventIcon1Filter: bills,waste # only events with those words will be shown
25-
calEventIcon2Filter: cleaning # only events with those words will be shown
2621
entities:
27-
- entity: calendar.YOUR_CALENDAR_HERE # no type, it won't be shown in calendar mode
28-
- type: holiday # events from this calendar will be red
29-
entity: calendar.YOUR_CALENDAR1_HERE
30-
- type: icon1,icon2 # will show icon1 and icon2, but with filters configured above
31-
entity: calendar.home_events
32-
- type: icon3 # icon1 has no filters, show all events from this calendar
33-
entity: calendar.birthday
34-
```
35-
36-
```yaml
37-
entities:
38-
- entity: calendar.YOUR_CALENDAR_HERE
39-
type: holiday # events from this calendar will be red
22+
- entity: calendar.YOUR_CALENDAR_HERE # no icon, it won't be shown in calendar mode
4023
- entity: calendar.YOUR_CALENDAR1_HERE
41-
type: icon2,icon3 # will show icon2 and icon3, but with filters configured below
42-
- entity: calendar.birthday
43-
type: icon1 # Icon1 has no filters, show all events from this calendar
44-
- entity: calendar.YOUR_CALENDAR2_HERE # no type, it won't be shown in calendar mode
45-
calEventIcon1Filter: bills,waste # only events with those words will be shown
46-
calEventIcon2Filter: cleaning # only events with those words will be shown
24+
icon: 'mdi:palm-tree' # events from this calendar will have a palm tree icon
25+
color: 'red' # events from this calendar will be red
26+
- entity: calendar.home_events
27+
icon: 'mdi:home-heart' # will show icon but only for events with "family" in the title
28+
whitelist: family
4729
```
4830
49-
If you set filters (keywords) for any type, it will show an icon only when event summary contains one of keywords. If you don't set any filter, it will show icons for all days with any events.
31+
If you set a whitelist (keywords) for any entity, it will show an icon only when event summary contains one of the keywords. If you don't set any filter, it will show icons for all days with any events.

docs/faq.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ nav_order: 5
99
## How come Calendar View doesnt who all my items?
1010

1111
By default only 5 events will be pulled from Google Calendar, to change this you need to follow the instructions [here](/atomic-calendar-revive/quickstart#show-more-than-5-events)
12+
13+
## My color scheme is not showing as expected
14+
15+
If your color scheme is not showing as expected and you are using a custom theme, first please swap back to the default theme and see if this resolves the issue.

docs/options/calendar-mode-options.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,11 @@ nav_order: 4
1010
| Name | Type | Since | Description |
1111
| ---------------------- | :-----: | :----: | ----------------------------------------------------------------------------------------------------- |
1212
| enableModeChange | boolean | v0.7.0 | `false` Set true to enable mode change (Calendar/Events) must have "name" set to toggle |
13-
| defaultMode | integer | v0.7.0 | `1` Set `1` to make Events default mode, set `2` to make Calendar mode default |
1413
| firstDayOfWeek | integer | v0.7.0 | `1` First day of week, default 1 for Monday |
15-
| calEventIcon1 | string | v0.7.0 | `mdi:gift` Icon for `type: icon1` calendar |
16-
| calEventIcon1Filter | string | v0.7.0 | `null` List of comma separated keywords |
17-
| calEventIcon2 | string | v0.7.0 | `mdi:home` Icon for `type: icon2` calendar |
18-
| calEventIcon2Filter | string | v0.7.0 | `null` List of comma separated keywords |
19-
| calEventIcon3 | string | v0.7.0 | `mdi:star` Icon for `type: icon3` calendar |
20-
| calEventIcon3Filter | string | v0.7.0 | `null` List of comma separated keywords |
2114
| showLastCalendarWeek | boolean | v0.7.5 | `false` If true it will always show 6 lines. If false, the 6th line won't be displayed if not needed. |
22-
| calEventTime | bool | v1.5.0 | `false` If true the time will be shown on the event summary for the selected day |
23-
| disableCalEventLink | bool | v1.5.0 | `false` If true the link will be disabled on the event summary for the selected day |
24-
| disableCalLocationLink | bool | v1.5.0 | `false` If true the link will be disabled on the event location icon for the selected day |
15+
| calEventTime | boolean | v1.5.0 | `false` If true the time will be shown on the event summary for the selected day |
16+
| disableCalEventLink | boolean | v1.5.0 | `false` If true the link will be disabled on the event summary for the selected day |
17+
| disableCalLocationLink | boolean | v1.5.0 | `false` If true the link will be disabled on the event location icon for the selected day |
2518

2619
## Color Options
2720

docs/options/entity-options.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,26 @@ parent: Configuration Options
55
nav_order: 2
66
---
77

8-
| Name | Type | Since | Description |
9-
| ------------ | :----: | :----: | ------------------------------------------------------------------------------------------------------ |
10-
| type | string | v0.5.5 | `null` Type of calendar (in calendar mode) Icon1, Icon2, Icon3, Birthday. Explained below. |
11-
| blacklist | string | v0.7.9 | `null` List of comma separated blacklisted keywords. Events containing any of them will not be shown. |
12-
| whitelist | string | v1.1.0 | `null` List of comma separated whitelisted keywords. Only events containing any of them will be shown. |
13-
| eventCalName | string | v1.2.0 | `null` Add a calendar name to be shown with event. |
8+
| Name | Type | Since | Description |
9+
| --------------- | :----: | :----: | ------------------------------------------------------------------------------------------------------ |
10+
| type | string | v0.5.5 | `null` Type of calendar (in calendar mode) Icon1, Icon2, Icon3, Birthday. Explained below. |
11+
| blacklist | string | v0.7.9 | `null` List of comma separated blacklisted keywords. Events containing any of them will not be shown. |
12+
| whitelist | string | v1.1.0 | `null` List of comma separated whitelisted keywords. Only events containing any of them will be shown. |
13+
| eventCalName | string | v1.2.0 | `null` Add a calendar name to be shown with event. |
14+
| icon | string | v2.0.0 | `null` Add an icon to a calendar |
15+
| startTimeFilter | string | v2.0.0 | Only shows events between specific times _NOTE_ must be set with `endTimeFilter` format: `'10:00'` |
16+
| endTimeFilter | string | v2.0.0 | Only shows events between specific times _NOTE_ must be set with `startTimeFilter` format: `'17:00'` |
17+
18+
---
19+
20+
**NOTE**
21+
22+
It is not advised to use whitelist & Balcklist under the same entity.
23+
24+
---
1425

1526
## Color Options
1627

17-
| Name | Type | Since | Description |
18-
| ----- | :----: | :----: | ----------------------------------- |
19-
| color | string | v1.5.0 | `defaultCalColor` Color of calendar |
28+
| Name | Type | Since | Description |
29+
| ----- | :----: | :----: | ------------------------------------------------------------------------- |
30+
| color | string | v1.5.0 | `defaultCalColor` Color of event title for specific calendar & Icon color |

docs/options/main-options.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ nav_order: 1
1010
| type | string | **required** | v0.3.0 | `custom:atomic-calendar-revive` |
1111
| entities | list | **required** | v0.3.0 | One or more calendars, configured in HA [Google Calendar Component][googlecalcomp] |
1212
| name | string | optional | v0.12.0 | Card name. |
13-
| showColors | boolean | optional | v0.3.0 | `true` Show colors in events, configured in entities list |
1413
| maxDaysToShow | integer | optional | v0.3.0 | `7` Maximum number of days to show; if set to zero will only display currently running events |
1514
| maxEventCount | integer | optional | v0.9.0 | `0` Maximum number of events to show; zero removes any limitation |
1615
| showLocation | boolean | optional | v0.3.0 | `true` Show location link (right side) |
@@ -25,10 +24,9 @@ nav_order: 1
2524
| disableEventLink | boolean | optional | v0.10.0 | `false` disables links in event title. |
2625
| disableLocationLink | boolean | optional | v0.10.0 | `false` disables links in event location. |
2726
| linkTarget | string | optional | v0.11.0 | `_blank` Allows custom target for links, default will open new tab. |
28-
| showCalNameInEvent | string | optional | ? | `false` Shows the event calendar name |
2927
| showFullDayProgress | string | optional | v1.7.0 | `false` Enables the progress bar for full day events |
30-
| showDeclined | string | optional | v1.9.0 | `false` Shows events that have been declined |
31-
28+
| showDeclined | boolean | optional | v2.0.0 | `false` show/hide events that have been declined |
29+
| defaultMode | integer | optional | v2.0.0 | `Event` Set `Event` to make Events default mode, set `Calendar` to make Calendar mode default |
3230

3331
# Color Options
3432

0 commit comments

Comments
 (0)