From 085392a7772a2f8d77294095cd325e253ff72ce9 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sun, 4 Aug 2024 14:26:27 -0500 Subject: [PATCH] add doc for new compliments(#3481) and support custom positions (#3518) (#254) * add doc for new compliments(#3481) and support custom positions (#3518) * fix typo --- modules/compliments.md | 23 +++++++++++++++++++++++ modules/configuration.md | 5 +++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/modules/compliments.md b/modules/compliments.md index 9f5d4f4a..04ea1255 100644 --- a/modules/compliments.md +++ b/modules/compliments.md @@ -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

+**minute hour day month day_of_week**

+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` @@ -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 +
"* 20-21 31 10 *":["Boo!!"] + + #### Example use with weather module ```javascript diff --git a/modules/configuration.md b/modules/configuration.md index bdcdf43d..2f0beccc 100644 --- a/modules/configuration.md +++ b/modules/configuration.md @@ -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:

if your implementation of MagicMirror wishes to use custom position values, they need used in **index.html** to be in the format

class="region newpos-a newpos-b"

MagicMirror will underscore join the last two terms to make a position value like

newpos-a_newpos-b

example: class="region top3 left"
the position will be "top3_left"

newpos_b is optional
class="region top3" would be valid and produce a position of "top3"

the new position values will be checked during MagicMirror startup and also in the configuration checker
npm run config:check

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. |