Skip to content

Commit 40e4a2e

Browse files
authored
Merge pull request #181 from FamousWolf/dev
[MERGE] Changes for version 1.9.0
2 parents 395343f + 1049c5f commit 40e4a2e

File tree

5 files changed

+1030
-1011
lines changed

5 files changed

+1030
-1011
lines changed

README.md

+51-8
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Custom Home Assistant card displaying a responsive overview of multiple days wit
3939
Add:
4040
```yaml
4141
resources:
42-
- url: /local/week-planner-card.js?version=1.8.0
42+
- url: /local/week-planner-card.js?version=1.9.0
4343
type: module
4444
```
4545
- **Using the graphical editor**
@@ -79,6 +79,7 @@ Custom Home Assistant card displaying a responsive overview of multiple days wit
7979
| `hideDaysWithoutEvents` | boolean | false | `false` \| `true` | Do not show days without events, except for today | 1.4.0 |
8080
| `hideTodayWithoutEvents` | boolean | false | `false` \| `true` | Also do not show today without events if `hideDaysWithoutEvents` is set | 1.8.0 |
8181
| `filter` | string | optional | Any regular expression | Remove events that match the regular expression | 1.7.0 |
82+
| `combineSimilarEvents` | boolean | false | `false` \| `true` | Combine events with the same start date/time, end date/time and title | 1.9.0 |
8283

8384
### Calendars
8485

@@ -112,16 +113,17 @@ See [Actions documentation](https://www.home-assistant.io/dashboards/actions/).
112113

113114
### Weather
114115

115-
| Name | Type | Default | Supported options | Description | Version |
116-
|----------------------|---------|--------------|------------------------------|----------------------|---------|
117-
| `entity` | string | **Required** | `weather.my_weather_service` | Entity ID | 1.1.0 |
118-
| `showCondition` | boolean | true | `false` \| `true` | Show condition icon | 1.1.0 |
119-
| `showTemperature` | boolean | false | `false` \| `true` | Show temperature | 1.1.0 |
120-
| `showLowTemperature` | boolean | false | `false` \| `true` | Show low temperature | 1.1.0 |
116+
| Name | Type | Default | Supported options | Description | Version |
117+
|----------------------|---------|--------------|------------------------------|--------------------------------------------------------------------------------|---------|
118+
| `entity` | string | **Required** | `weather.my_weather_service` | Entity ID | 1.1.0 |
119+
| `useTwiceDaily` | boolean | false | `false` \| `true` | Use twice daily forecast if your weather entity doesn't support daily forecast | 1.9.0 |
120+
| `showCondition` | boolean | true | `false` \| `true` | Show condition icon | 1.1.0 |
121+
| `showTemperature` | boolean | false | `false` \| `true` | Show temperature | 1.1.0 |
122+
| `showLowTemperature` | boolean | false | `false` \| `true` | Show low temperature | 1.1.0 |
121123

122124
## Custom styling using cardmod
123125

124-
Like with most cards, you can add custom styling to this card using [card_mod](https://github.com/thomasloven/lovelace-card-mod). To make it easier to add custom styles to days and/or events, there are several classes that days and events can have.
126+
Like with most cards, you can add custom styling to this card using [card_mod](https://github.com/thomasloven/lovelace-card-mod). To make it easier to add custom styles to days and/or events, there are several classes that days and events can have. Additionally, there are data attributes you can use in CSS selectors.
125127

126128
### Day classes
127129

@@ -140,6 +142,17 @@ Like with most cards, you can add custom styling to this card using [card_mod](h
140142
| `friday` | Day is a friday | 1.6.0 |
141143
| `saturday` | Day is a saturday | 1.6.0 |
142144

145+
### Day data attributes
146+
147+
| Data attribute | Description | Version |
148+
|----------------|--------------------|---------|
149+
| `data-date` | The day number | 1.7.0 |
150+
| `data-weekday` | The weekday number | 1.7.0 |
151+
| `data-month` | The month number | 1.7.0 |
152+
| `data-year` | The year | 1.7.0 |
153+
| `data-week` | The week number | 1.7.0 |
154+
155+
143156
### Event classes
144157

145158
| Class | Description | Version |
@@ -149,6 +162,19 @@ Like with most cards, you can add custom styling to this card using [card_mod](h
149162
| `future` | Event in the future | 1.5.0 |
150163
| `past` | Event in the past | 1.5.0 |
151164

165+
### Event data attributes
166+
167+
| Data attribute | Description | Version |
168+
|----------------------------|-----------------------------------------------------------------|---------|
169+
| `data-entity` | The calendar entity | 1.6.0 |
170+
| `data-additional-entities` | Comma-separated list of additional entities for combined events | 1.9.0 |
171+
| `data-summary` | The event title | 1.9.0 |
172+
| `data-location` | The event location | 1.9.0 |
173+
| `data-start-hour` | The event start hour | 1.9.0 |
174+
| `data-start-minute` | The event start minute | 1.9.0 |
175+
| `data-end-hour` | The event end hour | 1.9.0 |
176+
| `data-end-minute` | The event end minute | 1.9.0 |
177+
152178
## Examples
153179

154180
### Minimal
@@ -216,6 +242,23 @@ card_mod:
216242
}
217243
```
218244

245+
### Custom event style based on title text with card_mod
246+
247+
This will style events with `Word1` as part of the title or `Word2` as the exact title with a red background.
248+
249+
```yaml
250+
type: custom:week-planner-card
251+
calendars:
252+
- entity: calendar.my_calendar_1
253+
- color: #e6c229
254+
card_mod:
255+
style: |
256+
.event[data-summary~="Word1"],
257+
.event[data-summary="Word2"] {
258+
background-color: #ff0000 !important;
259+
}
260+
```
261+
219262
### Show entire current month
220263

221264
```yaml

0 commit comments

Comments
 (0)