diff --git a/datetime/README.md b/datetime/README.md new file mode 100644 index 00000000..de861258 --- /dev/null +++ b/datetime/README.md @@ -0,0 +1,42 @@ + + +The time plugin allows you create rules based on the time, day, month, year, weekday or on weekend. + +For the correct setup you can configure the time zone in the plugin configuration. The language +of the "month name" and "weekday name" depends on the locale settings of the system. To have the correct +time you need [ntp](https://en.wikipedia.org/wiki/Network_Time_Protocol). + +The weekday integer value stands for: + +| Weekday | Int | +| ------------- |:-------------:| +| Monday | 1 +| Tuesday | 2 +| Wednesday | 3 +| Thursday | 4 +| Friday | 5 +| Saturday | 6 +| Sunday | 7 + + +The "weekend" \l{State} will be true, if the current weekday is Saturday or Sunday, otherwise it will be false. + +## Today + +The today plugin gives you information about the current day and some special times of the day like +dawn, sunrise, noon, sunset and dawn. In order to get the correct times of the current day for your location, the plugin needs to know where +you are. The plugin will autodetect your location according to you WAN IP [http://ip-api.com/json](http://ip-api.com/json)) +and will download the sunset / sunrise times from the online database [http://sunrise-sunset.org/](http://sunrise-sunset.org/). +If the configured timezone does not match with the autodetected timezone from the ip the specialdates will be set to 0 (01.01.1970 - 00:00.00). + +![Day times](https://raw.githubusercontent.com/guh/nymea-plugins/master/datetime/docs/images/day-times.png "Day times") + +Special times of a day ([original source](https://en.wikipedia.org/wiki/Twilight#/media/File:Twilight_description_full_day.svg)) + +## Alarm + +The alarm plugin allows you to define an alarm which depends on a certain time, weekday or special day time like sunrise or +sunset. An offset can also be definend. + +## Countdown +The countdown plugin allows you to define a countown which triggers an event on timeout. diff --git a/datetime/deviceplugindatetime.cpp b/datetime/deviceplugindatetime.cpp index e13c5fd1..7d4815cc 100644 --- a/datetime/deviceplugindatetime.cpp +++ b/datetime/deviceplugindatetime.cpp @@ -20,77 +20,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/*! - \page datetime.html - \title Time - \brief Plugin for timezone based time information. - - \ingroup plugins - \ingroup nymea-plugins - - The time plugin allows you create rules based on the time, day, month, year, weekday or on weekend. - - For the correct setup you can configure the time zone in the plugin configuration. The language - of the "month name" and "weekday name" depends on the locale settings of the system. To have the correct - time you need \l{https://en.wikipedia.org/wiki/Network_Time_Protocol}{ntp}. - - The weekday integer value stands for: - \table - \header - \li Weekday - \li int - \row - \li Monday - \li 1 - \row - \li Tuesday - \li 2 - \row - \li Wednesday - \li 3 - \row - \li Thursday - \li 4 - \row - \li Friday - \li 5 - \row - \li Saturday - \li 6 - \row - \li Sunday - \li 7 - \endtable - - The "weekend" \l{State} will be true, if the current weekday is Saturday or Sunday, otherwise it will be false. - - \chapter Today - The today plugin gives you information about the current day and some special times of the day like - dawn, sunrise, noon, sunset and dawn. In order to get the correct times of the current day for your location, the plugin needs to know where - you are. The plugin will autodetect your location according to you wan ip (\l{http://ip-api.com/json}{http://ip-api.com/json}) - and will download the sunset / sunrise times from the online database \l{http://sunrise-sunset.org/}{http://sunrise-sunset.org/}. - If the configured timezone does not match with the autodetected timezone from the ip the specialdates will be set to 0 (01.01.1970 - 00:00.00). - - \image day-times.png - - Special times of a day (\l{https://en.wikipedia.org/wiki/Twilight#/media/File:Twilight_description_full_day.svg}{original source}) - - \chapter Alarm - The alarm plugin allows you to define an alarm which depends on a certain time, weekday or special day time like sunrise or - sunset. An offset can also be definend. - - \chapter Countdown - The countdown plugin allows you to define a countown which triggers an \l{Event} on timeout. - - \chapter Plugin properties - Following JSON file contains the definition and the description of all available \l{DeviceClass}{DeviceClasses} - and \l{Vendor}{Vendors} of this \l{DevicePlugin}. - - For more details how to read this JSON file please check out the documentation for \l{The plugin JSON File}. - - \quotefile plugins/deviceplugins/datetime/deviceplugindatetime.json -*/ - #include "deviceplugindatetime.h" #include "plugin/device.h" diff --git a/datetime/docs/images/day-times.png b/datetime/docs/images/day-times.png new file mode 100644 index 00000000..784d2cd9 Binary files /dev/null and b/datetime/docs/images/day-times.png differ diff --git a/datetime/docs/images/day-times.svg b/datetime/docs/images/day-times.svg new file mode 100644 index 00000000..bb3492c6 --- /dev/null +++ b/datetime/docs/images/day-times.svg @@ -0,0 +1,638 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + "Object to Path" on text (angled text won't display properly otherwise) + + + + + + + + horizon + dusk + sunset + dawn + sunrise + twilight + twilight + + + + + + Original (editable) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + noon + + +