# SuperDateTime plugin.pm by Greg Brown Feb 2005-2014, Don Grossman 2014-2025 # Copyright (c) 2025 # All rights reserved. # # DESCRIPTION # SlimServer plugin screensaver datetime replacement. Graphically displays current weather conditions and forecasts. # Will also optionally display stock quotes and upcoming/current game information for MLB, NBA, NHL, NFL, and college # football and basketball teams at user-configurable intervals. # # REMOTE CONTROL # Pressing up or down cycles the information shown on line one during time display. It will also immediately # display the time if it is not currently being shown. # Pressing right or left cycles through the available games and long weather forecasts that normally cycle automatically. # Pressing FWD or REW cycles through the long weather forecasts. # Pressing '+' will force an immediate data refresh. # # This screen saver is based on the standard SlimServer DateTime screensaver written written by kdf. # The graphical weather icons and the code to support them are based on the WeatherTime screensaver written by Martin Rehfeld. # # VERSION HISTORY # 5.11.46 07/02/25 Preliminary release to address changes to weather data API. # Only current observations available. Release with forecasted data will follow. # Add WNBA Sports Scores. # # 5.11.45 04/09/25 Add intermission indicator to NHL Game Clock. # # 5.11.44 01/04/25 Add Seattle Kraken and remove Arizona Coyotes from NHL Hockey Teams. Thanks @tedfroop. # Improve error handling for stocks. # # 5.11.43 12/15/24 Added Danish translations. Thanks @cfuttrup. # # 5.11.42 11/29/24 Improve parsing of NBA game clock for active games. # Reestablished Stock Quotes. # # 5.11.41 11/16/24 Add Utah Hockey Club to NHL Teams list in SDT settings. # # 5.11.40 09/23/24 Store sports team logos locally. # # 5.11.39 05/15/24 Fix weather data retrieval. # # 5.11.38 04/22/24 Initial fix for weather RADAR maps. LMS running on Linux and Jivelite players only. # Added Czech translations for months. Thanks @mipa87 # Allow SDT to load on Lyrion Music Server. Updated max LMS version to 9.* # # 5.11.37 01/22/24 Added ability to display shortened college team names for NCAA Football and Basketball. # Improved detection of halftime for NCAA Basketball. # # 5.11.36 11/15/23 Custom Clock Helper infotype "getLongWeather" was replaced with "LongWeather" in 5.11.35. # For backwards compatibility, CCH infotype "getLongWeather" is added back. Thanks @bluetdi # # 5.11.35 11/11/23 Improved retrieval of Long Weather forecasts. # Added 15-Days of Long Weather forecasts. # Fixed retrieval of NHL score data. # When Forecast High is NULL replace with Max Observed Temperature. # # 5.11.34 10/29/23 Fixed missing Moonrise, Moonset, and Moon Phase information. # Added 15-day Moon ICONs # Added Macro Variable for WU Station. # # 5.11.33 10/22/23 Fixed 15-Day Sunrise and Sunset times. # Added 15-Day Moonrise, Moonset, and Moon Phase information. # Updated to not try stocks until crumb is set. # # 5.11.32 10/05/23 Updated to not set finance cookie or crumb unless Stock(s) are selected. # # 5.11.31 09/23/23 Fixed retrieval of Stock data. Thanks @Paul Webster and @expectingtofly # # 5.11.30 03/18/23 Updated Macro Variables listing. See LMS->Settings->Player->SDT. # Updated SDT Extras menu to show Moonrise and Moonset in 12 Hour format when Fahrenheit selected. # Removed leading zeros from weather.com forecast period dates. # # 5.11.29 02/18/23 Added Day and 52 week price ranges to stocks. New macro code: %R # Added 12 Hour time format for Sunrise, Sunset, Moonrise, and Moonset times. # New macro codes: %!s & %!S and %!n & %!N # # 5.11.28 11/26/22 Restored TV Broadcaster info for NBA games. # Improved detection of End of Quarter for NBA games. # Removed unused perl libraries from distribution to # eliminate conflicts with other LMS plugins. Thanks to @philippe_44 # # 5.11.27 11/04/22 Adjusted College Basketball start of season for 2022 # # 5.11.26 10/25/22 Fixed weather and wunderground data retrieval issues. # Fixed NBA scores for 2022 season. # Added more error checking for weather.com indentifier entries. # Automatically add suffixes to US postal codes and weather.codes Station entries. # Improved display of weather station names. # # 5.11.25 Skipped version. # # 5.11.24 08/21/22 Refined NFL json data retrieval. # Added setting for data refresh interval during active games. # # 5.11.23 04/09/22 Added error handling for locations that do not have weather average data. # # 5.11.22 03/23/22 Updated to correctly handle new MLB team name for Cleveland. # # 5.11.21 02/23/22 Fixed bug preventing Stocks from displaying in the Extras->SDT menu. # # 5.11.20 02/13/22 Replaced deprecated URL for obtaining geolocation information. # Added macro variables for wunderground observation time (%0) and refresh time (%!0) # Added setting for Player Check Delay following boot or LMS restart. Reset default delay from 5 seconds to 90. # Updated Stock data source to current URL # # 5.11.19 02/03/22 Fixed team icons for NCAA sports. # Added macro variable (%!1) to show status of last data refresh in Custom Clock screens. # Added French translations. Thanks @steveJC # Fixed average and record temperatures. # # 5.11.18 01/10/22 Fixed data retrieval issues from weather.com # Added wind Gust for both wunderground and weather.com stations. # # 5.11.17 11/10/21 Fixed SDT icon display in Extras menu on Jive/Jivelite platforms. Thanks @MichaelPr # Added Swedish translations. Thanks @robho # # 5.11.16 04/11/21 Added space between Wind Direction and Wind Speed. # wunderground compass directions are now adjusted for language selection. # Month names in 10-day forecast are now adjusted for language selection. # Month Day order in 10-day forecast is now adjusted based on temperature units selection. (F or C) # Added new macro variables for Wind Speed only. (without Wind Direction) # Precipitation units adjusted in Extras->SDT menu based on selected temperature units. (F or C) # Improved formatting of WU temp and wind speed in Extras->SDT menu. # Precipitation units in Extras->SDT are now adjusted based on F or C preference setting. # # 5.11.15 03/23/21 Added to option to disable visualizer when SDT is active. # # 5.11.14 03/14/21 Fixed forecasted wind speed periods C, 1, 2, & 3. # Added forecasted wind speeds for "10-day" periods. # Updated macro variables listing on the Settings->Player->SDT page. # mi/hr = %!w, km/hr = %!W, kt = %!q, m/s = %!Q # # 5.11.13 03/04/21 Added forecasted wind speed information. Access using these macro variables: # mi/hr = %!w, km/hr = %!W, kt/hr = %!q, m/s = %!Q # Fixed game detection for MLB sports scores # # 5.11.12 02/07/21 Added setting to shorten display names for professional sports teams. # Fixed setting for NBA team selection. # # 5.11.11 01/14/21 Fixed upcoming game times for NHL games. # # 5.11.10 01/12/21 Improvements to German language translation. Thanks @bluetdi # # 5.11.9 01/09/21 Added setting to select Air Pressure units displayed in Extras menu. # Improved language localization. # # 5.11.8 01/06/21 Adapted wunderground to pull precision JSON data and limited rounding in # temperature conversions to 1 decimal. # # 5.11.7 12/31/20 Added Feels-like temperature for wunderground weather stations. - Thanks @peterw # # 5.11.6 12/21/20 Corrected copy and paste error affecting chance of precip in 15-day forecasts. # Corrected logic causing rounded chance of precipitation to be blanked when chance equals 0. # # 5.11.5 12/05/20 Added rounding to nearest 5% of precipitation chance values to # account for change in weather source data to 1% resolution. # Added macro variables for 1% resolution values. # # 5.11.4 11/08/20 Fixed detection of active NFL games. # Corrected short NFL team identifiers for Raiders and Chargers. # # 5.11.3 10/04/20 Fixed NFL scores for 2020 season # Improved inning display count for MLB games that finish early. # # 5.11.2 08/23/20 Documented variable %G for Moon Phase description on Settings-->Player-->SDT page. # Added DE ES and NL translations for weather period "Currently". # # 5.11.1 05/05/20 Weather radar maps are now available through Custom Clock Helper itemtype: sdtweathermapicon # Added max observed temperature to Extras->SDT menu # Corrected typos in the German translation on the settings page. Thanks @carsten_h # Added rounding to barometric pressure hPa units. Thanks @bluetdi # # 5.11.0 05/03/20 Corrected wind speed calculations when JSON file with metric data is used. - Thanks @robho # Corrected barometric pressure calculations when JSON file with metric data is used. # # Bumped from 5.9.58 to 5.11.0 when Wunderground removed free access to API. # Started weather.com JSON rewrite with Greg Brown's 5.9.14 version.