diff --git a/doc/images/day-times.png b/doc/images/day-times.png new file mode 100644 index 00000000..784d2cd9 Binary files /dev/null and b/doc/images/day-times.png differ diff --git a/doc/images/day-times.svg b/doc/images/day-times.svg new file mode 100644 index 00000000..bb3492c6 --- /dev/null +++ b/doc/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 + + + diff --git a/plugins/deviceplugins/datetime/deviceplugindatetime.cpp b/plugins/deviceplugins/datetime/deviceplugindatetime.cpp index 076f3558..252091ec 100644 --- a/plugins/deviceplugins/datetime/deviceplugindatetime.cpp +++ b/plugins/deviceplugins/datetime/deviceplugindatetime.cpp @@ -27,9 +27,9 @@ The time plugin allows you create rules based on the time, day, month, year, weekday or on weekend. - For the setup you need to specify the continent, afterwards you can select your city/timezone. The language - of the "month name" and "weekday name" depends on your locale settings. To have the correct time you need - \l{https://en.wikipedia.org/wiki/Network_Time_Protocol}{ntp}. + 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 @@ -61,6 +61,25 @@ 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 allowes 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 allowes 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}. @@ -179,6 +198,8 @@ DeviceManager::DeviceSetupStatus DevicePluginDateTime::setupDevice(Device *devic device->paramValue("repeating").toBool()); connect(countdown, &Countdown::countdownTimeout, this, &DevicePluginDateTime::onCountdownTimeout); + connect(countdown, &Countdown::runningStateChanged, this, &DevicePluginDateTime::onCountdownRunningChanged); + qCDebug(dcDateTime) << "setup countdown" << countdown->name() << countdown->time().toString(); m_countdowns.insert(device, countdown); } diff --git a/plugins/deviceplugins/datetime/deviceplugindatetime.json b/plugins/deviceplugins/datetime/deviceplugindatetime.json index affab415..a874813b 100644 --- a/plugins/deviceplugins/datetime/deviceplugindatetime.json +++ b/plugins/deviceplugins/datetime/deviceplugindatetime.json @@ -215,9 +215,9 @@ { "name": "offset", "type": "int", + "minValue": -120, + "maxValue": 120, "unit": "Minutes", - "minValue": -59, - "maxValue": 59, "defaultValue": 0 } ],