Skip to content

Commit

Permalink
add doc for new compliments(#3481) and support custom positions (#351…
Browse files Browse the repository at this point in the history
…8) (#254)

* add doc for new compliments(#3481) and support custom positions (#3518)

* fix typo
  • Loading branch information
sdetweil authored Aug 4, 2024
1 parent 89b6259 commit 085392a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
23 changes: 23 additions & 0 deletions modules/compliments.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ compliments.
Compliments can be set for a specific day in the format `YYYY-MM-DD`. `.` can be
used as a wildcard.

starting in Version 2.29, the compliments configuration can use a cron type specification, which provides more options. In addition to date, one can use hours, minutes and day of week for additional control
the cron format string is 5 groups of space separated values<br><br>
**minute hour day month day_of_week**<br><br>
each can be a range, and use numbers or names
see https://crontab-generator.org for a visual cron syntax creator.. this tool asks for the command to be executed (cron is usually used to execute commands on a schedule), just use anything, and take the first 5 space separated tokens of the result.

If set, the weather can be used for compliments. The available properties are:

- `day_sunny`
Expand Down Expand Up @@ -92,6 +98,23 @@ config: {
}
```

#### Example use with a cron entry

```javascript
config: {
compliments: {
"48-50 16-18 * * 5,6": [
"Happy Hour!", "Its a Party"
]
}
}
```
this means, on Friday or Saturday, every week (* (every) month/day) between 16:48-16:50, 17:48-17:50, and 18:48-18:50, the assigned messages will be used. note: like with the date only setting, if these are the only possible messages you want displayed, you need to set **specialDayUnique:true**

another example,. you could use this for scary messages ONLY on between 8 and 9pm Halloween evening
<br>"* 20-21 31 10 *":["Boo!!"]


#### Example use with weather module

```javascript
Expand Down
5 changes: 3 additions & 2 deletions modules/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ see [configuration](/configuration/introduction.md) for more information.
| **Option** | **Description** |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `module` | The name of the module. This can also contain the subfolder. Valid examples include `clock`, `default/calendar` and `custommodules/mymodule`. |
| `position` | The location of the module in which the module will be loaded. Possible values are `top_bar`, `top_left`, `top_center`, `top_right`, `upper_third`, `middle_center`, `lower_third`, `bottom_left`, `bottom_center`, `bottom_right`, `bottom_bar`, `fullscreen_above`, and `fullscreen_below`. This field is optional but most modules require this field to set. Check the documentation of the module for more information. Multiple modules with the same position will be ordered based on the order in the configuration file. |
| `classes` | One or more additional CSS classes which will be set on the module, as a string of space-separated values. This field is optional. |
| `position` | The location of the module in which the module will be loaded. The built in values are `top_bar`, `top_left`, `top_center`, `top_right`, `upper_third`, `middle_center`, `lower_third`, `bottom_left`, `bottom_center`, `bottom_right`, `bottom_bar`, `fullscreen_above`, and `fullscreen_below`. This field is optional but most modules require this field to set. (if not set, the module will not be shown, but will run the same) Check the documentation of the module for more information. Multiple modules with the same position will be ordered based on the order in the configuration file, top down. |
| | Note: <br><br>if your implementation of MagicMirror wishes to use custom position values, they need used in **index.html** to be in the format <br><br>class="region newpos-a newpos-b"<br> <br>MagicMirror will underscore join the last two terms to make a position value like <br><br>newpos-a_newpos-b<br><br>example: class="region top3 left" <br>the position will be "top3_left"<br><br>newpos_b is optional<br>class="region top3" would be valid and produce a position of "top3"<br><br>the new position values will be checked during MagicMirror startup and also in the configuration checker <br> npm run config:check <br><br> AND you have to have the appropriate css settings in custom.css for these new region values (top3 and left as used in the example above)|
| `classes` | One or more additional CSS classes which will be set on the module, as a string of space-separated values. This field is optional. |
| `header` | To display a header text above the module, add the header property. This field is optional. |
| `hiddenOnStartup` | Set module as being hidden on startup. This field is optional. |
| `disabled` | Set disabled to `true` to skip creating the module. This field is optional. |
Expand Down

0 comments on commit 085392a

Please sign in to comment.