From 24b568fa5a20d6de6ea42d3d984ec36998cdc676 Mon Sep 17 00:00:00 2001 From: Brendan Curley <17364941+SerBrynden@users.noreply.github.com> Date: Tue, 28 Nov 2023 11:22:41 -0700 Subject: [PATCH 01/13] Fixed Metar not updating and optimized code --- PiClock3/AnalogClock/AnalogClock.py | 43 +++++++++++------- PiClock3/Astral/Astral.py | 18 +++----- PiClock3/Date/Date.py | 18 +++----- PiClock3/DigitalClock/DigitalClock.py | 18 ++++---- PiClock3/Metar/Metar.py | 59 +++++++++++++------------ PiClock3/PiClock3.py | 47 ++++++++------------ PiClock3/WeatherCommon/WeatherCommon.py | 18 ++++---- PyQtPiClock3.py | 10 ++--- 8 files changed, 111 insertions(+), 120 deletions(-) diff --git a/PiClock3/AnalogClock/AnalogClock.py b/PiClock3/AnalogClock/AnalogClock.py index 074ccfe..0672ed7 100644 --- a/PiClock3/AnalogClock/AnalogClock.py +++ b/PiClock3/AnalogClock/AnalogClock.py @@ -1,17 +1,13 @@ -import logging -import time import datetime import locale -import os -import sys - -from ..Plugin import Plugin +import logging -from PyQt5 import QtGui, QtNetwork -from PyQt5.QtGui import QPixmap, QMovie, QBrush, QColor, QPainter, QTransform -from PyQt5.QtCore import Qt, QUrl, QTimer, QSize, QRect, QBuffer, QIODevice, QByteArray +from PyQt5.QtCore import Qt, QTimer +from PyQt5.QtGui import QPixmap, QTransform from PyQt5.QtWidgets import QFrame, QLabel +from ..Plugin import Plugin + logger = logging.getLogger(__name__) @@ -19,6 +15,19 @@ class Plugin(Plugin): def __init__(self, piclock, name, config): super().__init__(piclock, name, config) + self.ctimer = None + self.lastmin = None + self.secpixmap2 = None + self.secpixmap = None + self.minpixmap2 = None + self.minpixmap = None + self.hourpixmap2 = None + self.hourpixmap = None + self.sechand = None + self.minhand = None + self.hourhand = None + self.clockrect = None + self.clockface = None def start(self): self.clockface = QFrame(self.block) @@ -74,9 +83,9 @@ def pageChange(self): def tick(self): time_now = datetime.datetime.now() - if 'date-locale' in self.config: + if 'locale' in self.config: try: - locale.setlocale(locale.LC_TIME, Config.DateLocale) + locale.setlocale(locale.LC_TIME, self.config.locale) except BaseException: pass angle = time_now.second * 6 @@ -91,8 +100,8 @@ def tick(self): self.sechand.setPixmap(self.secpixmap2) ts = self.secpixmap2.size() self.sechand.setGeometry( - self.clockrect.center().x() - ts.width() / 2, - self.clockrect.center().y() - ts.height() / 2, + int(self.clockrect.center().x() - ts.width() / 2), + int(self.clockrect.center().y() - ts.height() / 2), ts.width(), ts.height() ) @@ -110,8 +119,8 @@ def tick(self): self.minhand.setPixmap(minpixmap2) ts = minpixmap2.size() self.minhand.setGeometry( - self.clockrect.center().x() - ts.width() / 2, - self.clockrect.center().y() - ts.height() / 2, + int(self.clockrect.center().x() - ts.width() / 2), + int(self.clockrect.center().y() - ts.height() / 2), ts.width(), ts.height() ) @@ -128,8 +137,8 @@ def tick(self): self.hourhand.setPixmap(hourpixmap2) ts = hourpixmap2.size() self.hourhand.setGeometry( - self.clockrect.center().x() - ts.width() / 2, - self.clockrect.center().y() - ts.height() / 2, + int(self.clockrect.center().x() - ts.width() / 2), + int(self.clockrect.center().y() - ts.height() / 2), ts.width(), ts.height() ) diff --git a/PiClock3/Astral/Astral.py b/PiClock3/Astral/Astral.py index 43f7e02..bc07f67 100644 --- a/PiClock3/Astral/Astral.py +++ b/PiClock3/Astral/Astral.py @@ -1,19 +1,13 @@ +import datetime import logging -import time -import datetime -import locale -import os -import random import tzlocal - -from ..Plugin import Plugin - +from PyQt5.QtCore import QTimer from astral import LocationInfo -from astral.sun import sun from astral import moon +from astral.sun import sun -from PyQt5.QtCore import QTimer +from ..Plugin import Plugin logger = logging.getLogger(__name__) @@ -48,7 +42,7 @@ def doAstral(self): return locationInfo = LocationInfo('here', 'here', - tzlocal.get_localzone().zone, + tzlocal.get_localzone_name(), self.piclock.expand( self.config.location.lattitude), self.piclock.expand(self.config.location.longitude)) @@ -61,7 +55,7 @@ def doAstral(self): self.pluginData['moonphase'] = self.piclock.language( self.phaseWords(m)) self.pluginData['moonage'] = m - #self.pluginData['sunrise'] = s['sunrise'] + # self.pluginData['sunrise'] = s['sunrise'] ds = self.piclock.expand(self.config.format) self.block.setText(ds) diff --git a/PiClock3/Date/Date.py b/PiClock3/Date/Date.py index 3bad1d8..62f6518 100644 --- a/PiClock3/Date/Date.py +++ b/PiClock3/Date/Date.py @@ -1,16 +1,11 @@ -import logging - -import time import datetime import locale -import os -import random -import tzlocal - -from ..Plugin import Plugin +import logging from PyQt5.QtCore import QTimer +from ..Plugin import Plugin + logger = logging.getLogger(__name__) @@ -23,6 +18,7 @@ class Date(Plugin): def __init__(self, piclock, name, config): super().__init__(piclock, name, config) + self.timer = None self.lastDay = -1 def start(self): @@ -48,11 +44,11 @@ def doDate(self): # date sup = 'th' - if (now.day == 1 or now.day == 21 or now.day == 31): + if now.day == 1 or now.day == 21 or now.day == 31: sup = 'st' - if (now.day == 2 or now.day == 22): + if now.day == 2 or now.day == 22: sup = 'nd' - if (now.day == 3 or now.day == 23): + if now.day == 3 or now.day == 23: sup = 'rd' if 'locale' in self.config: sup = "" diff --git a/PiClock3/DigitalClock/DigitalClock.py b/PiClock3/DigitalClock/DigitalClock.py index 31282d0..dc6ba49 100644 --- a/PiClock3/DigitalClock/DigitalClock.py +++ b/PiClock3/DigitalClock/DigitalClock.py @@ -1,15 +1,12 @@ +import datetime import logging -import time -import datetime -import locale -import os +from PyQt5.QtCore import Qt, QTimer +from PyQt5.QtGui import QColor +from PyQt5.QtWidgets import QLabel, QGraphicsDropShadowEffect + from ..Plugin import Plugin -from PyQt5 import QtGui, QtNetwork -from PyQt5.QtGui import QPixmap, QMovie, QBrush, QColor, QPainter, QTransform -from PyQt5.QtCore import Qt, QUrl, QTimer, QSize, QRect, QBuffer, QIODevice, QByteArray -from PyQt5.QtWidgets import QFrame, QLabel, QGraphicsDropShadowEffect logger = logging.getLogger(__name__) @@ -17,6 +14,11 @@ class DigitalClock(Plugin): def __init__(self, piclock, name, config): super().__init__(piclock, name, config) + self.ctimer = None + self.lasttimestr = None + self.glow = None + self.clockrect = None + self.clockface = None def fontCalc(self, size): return "%dpx" % (float(size) * self.block.frameRect().height()) diff --git a/PiClock3/Metar/Metar.py b/PiClock3/Metar/Metar.py index 0e88376..164dd61 100644 --- a/PiClock3/Metar/Metar.py +++ b/PiClock3/Metar/Metar.py @@ -1,23 +1,16 @@ -import logging - -import time import datetime -import locale -import os +import logging import random -import tzlocal - -from ..Plugin import Plugin -from PyQt5 import QtGui, QtNetwork -from PyQt5.QtGui import QPixmap, QMovie, QBrush, QColor, QPainter, QTransform -from PyQt5.QtCore import Qt, QUrl, QTimer, QSize, QRect, QBuffer, QIODevice, QByteArray -from PyQt5.QtWidgets import QFrame, QLabel, QGraphicsDropShadowEffect -from PyQt5.QtNetwork import QNetworkReply +import tzlocal +from PyQt5 import QtGui +from PyQt5.QtCore import Qt, QUrl, QTimer from PyQt5.QtNetwork import QNetworkRequest - +from PyQt5.QtWidgets import QLabel from metar import Metar as MetarModule +from ..Plugin import Plugin + logger = logging.getLogger(__name__) @@ -27,7 +20,6 @@ def utcoffset(self, dt): class Metar(Plugin): - metar_cond = [ ('CLR', '', '', 'Clear', 'clear-day', 0), ('NSC', '', '', 'Clear', 'clear-day', 0), @@ -79,12 +71,22 @@ class Metar(Plugin): ('IC', '', '', 'Ice Crystals', 'snow', 13), ('PL', '', '', 'Ice Pellets', 'snow', 13), - ('GR', '', '+', 'Heavy Hail', 'thuderstorm', 14), - ('GR', '', '', 'Hail', 'thuderstorm', 14), + ('GR', '', '+', 'Heavy Hail', 'thunderstorm', 14), + ('GR', '', '', 'Hail', 'thunderstorm', 14), ] def __init__(self, piclock, name, config): super().__init__(piclock, name, config) + self.metarreply = None + self.timer = None + self.wdate = None + self.feelslike = None + self.wind = None + self.humidity = None + self.pressure = None + self.temper = None + self.wxdesc = None + self.wxicon = None self.wxconfig = self.piclock.config.plugins['weather-common'] self.wxcommon = piclock.plugins['weather-common'] @@ -216,7 +218,7 @@ def start(self): y = rr.top() + int(rr.height() * .95) self.wdate.setGeometry(x, y, w, h) - #self.clockrect = self.block.frameRect() + # self.clockrect = self.block.frameRect() # self.w.setGeometry(self.clockrect) # self.w.setStyleSheet( # "#w { background-color: transparent; " + @@ -228,10 +230,10 @@ def start(self): # # self.wx - timer = QTimer() - timer.timeout.connect(self.getMetar) - timer.start(1000 * self.wxconfig['refresh'] * - 60 + random.uniform(1000, 10000)) + self.timer = QTimer() + self.timer.timeout.connect(self.getMetar) + self.timer.start(int(1000 * self.wxconfig['refresh'] * + 60 + random.uniform(1000, 10000))) self.getMetar() logging.info("startup finished %s %s", self.name, self.module) @@ -242,7 +244,7 @@ def pageChange(self): def getMetar(self): logging.info("getMetar") metarurl = "https://tgftp.nws.noaa.gov/data/observations/metar/stations/" + \ - self.config.METAR + ".TXT" + self.config.METAR + ".TXT" logging.info("metar url %s", metarurl) r = QUrl(metarurl) r = QNetworkRequest(r) @@ -256,7 +258,7 @@ def gotMetar(self): if wxline.startswith(self.config.METAR): wxstr = wxline logging.info('wxmetar: %s', wxstr) - f = MetarModule.Metar(wxstr) + f = MetarModule.Metar(wxstr, strict=False) logging.info("metardata %s", f) dt = f.time.replace( tzinfo=TimeZoneUTC()).astimezone( @@ -312,11 +314,12 @@ def gotMetar(self): self.wxcommon.units('pressure', 'mb', f.press.value('MB'))) self.humidity.setText(self.piclock.language('humidity') + ' ' + self.wxcommon.humidity(f.temp.value('C'), f.dewpt.value('C'))) - ws = (self.piclock.language('wind') + ' ' + - self.wxcommon.units('direction', 'deg', f.wind_dir.value()) + ' ' + - self.wxcommon.units('speed', 'kph', f.wind_speed.value('KMH'))) + ws = self.piclock.language('wind') + if f.wind_dir: + ws += ' ' + self.wxcommon.units('direction', 'deg', f.wind_dir.value()) + ws += ' ' + self.wxcommon.units('speed', 'kph', f.wind_speed.value('KMH')) if f.wind_gust: - ws += (self.piclock.language('gusting') + ' ' + + ws += (' ' + self.piclock.language('gusting') + ' ' + self.wxcommon.units('speed', 'kph', f.wind_speed.value('KMH'))) self.wind.setText(ws) self.feelslike.setText(self.piclock.language('feels_like') + ' ' + diff --git a/PiClock3/PiClock3.py b/PiClock3/PiClock3.py index 0522303..c9a28ec 100644 --- a/PiClock3/PiClock3.py +++ b/PiClock3/PiClock3.py @@ -1,27 +1,16 @@ -import os -import sys -import time -import yaml -from yamlinclude import YamlIncludeConstructor -import logging -import logging.handlers -import queue -import datetime -import re import importlib import inspect -from .DottedDict import DottedDict -from .Config import Config -from .Plugin import Plugin +import logging +import logging.handlers +import os -from PyQt5 import (QtGui, QtNetwork) -from PyQt5.QtCore import (QObject, QThread, pyqtSlot, pyqtSignal, Qt, QRect, +from PyQt5 import (QtNetwork) +from PyQt5.QtCore import (Qt, QRect, QSize) -from PyQt5.QtWidgets import (QWidget, QLabel, QMessageBox, QListWidget, - QPushButton, QApplication, QTableWidget, - QGridLayout, QListWidgetItem, QTableWidgetItem, - QLineEdit, QFrame) -from PyQt5.QtGui import (QIcon, QIntValidator) +from PyQt5.QtWidgets import (QWidget, QLabel, QApplication, QFrame) + +from .DottedDict import DottedDict +from .Plugin import Plugin logger = logging.getLogger(__name__) @@ -41,7 +30,7 @@ def __init__(self, config): self.config = config super().__init__() self.screen = QApplication.desktop().screenGeometry() - logging.info("%s" % (self.screen)) + logging.info("%s" % self.screen) self.initData() self.initWidgets() self.showFullScreen() @@ -135,7 +124,7 @@ def nextFrame(self, n): page.setVisible(False) logging.debug("Current %s Max %s" % (current, count)) current = (current + n) % count - logging.debug("new Current %s" % (current)) + logging.debug("new Current %s" % current) for pageName in self.pages: page = self.pages[pageName] if page.pageNumber == current: @@ -163,14 +152,14 @@ def _buildFullStyleString(self, name, page, size=None): if 'background-image' in page: styleString += " border-image: url(" + \ - self.expand(page['background-image']) + \ - ") 0 0 0 0 stretch stretch;" + self.expand(page['background-image']) + \ + ") 0 0 0 0 stretch stretch;" if 'styles' in page: for sty in page.styles: styleString += " " + sty + ": " + \ - self.expand(str(page.styles[sty])) + ';' - # redo font size if it is a bare number and size of parent was passed + self.expand(str(page.styles[sty])) + ';' + # redo font size if it is a bare number and size of parent was passed if 'font-size' in page.styles and isinstance(size, QSize): fs = str(page.styles['font-size']) if fs.replace('.', '', 1).replace('-', '', 1).isnumeric(): @@ -228,7 +217,7 @@ def loadBlock(self, parent, blockName, block): % (blockName, type)) blockWidget.setObjectName(blockName) geometry = self._calcGeometry(parent, block) - logging.debug("Block Geometry: %s" % (geometry)) + logging.debug("Block Geometry: %s" % geometry) blockWidget.setGeometry(geometry) styleString = self._buildFullStyleString( blockName, block, blockWidget.size() @@ -236,7 +225,7 @@ def loadBlock(self, parent, blockName, block): logging.debug("Block Style " + styleString) blockWidget.setStyleSheet(styleString) if 'text' in block: - logger.debug("Block Text: %s" % (block.text)) + logger.debug("Block Text: %s" % block.text) blockWidget.setText(block.text) blockWidget.blockName = blockName blockWidget.blockType = type @@ -285,7 +274,7 @@ def _calcGeometry(self, parent, block): if 'bottom' in block: top = parentHeight - parentHeight * block.bottom - height - return QRect(left, top, width, height) + return QRect(int(left), int(top), int(width), int(height)) class LogHandler(logging.handlers.RotatingFileHandler): diff --git a/PiClock3/WeatherCommon/WeatherCommon.py b/PiClock3/WeatherCommon/WeatherCommon.py index b219508..13f64ba 100644 --- a/PiClock3/WeatherCommon/WeatherCommon.py +++ b/PiClock3/WeatherCommon/WeatherCommon.py @@ -1,6 +1,6 @@ - import datetime import math + from compassheadinglib import Compass from ..Plugin import Plugin @@ -40,7 +40,7 @@ def units(self, utype, uin, data): data = (data - 32.0) / 1.8 elif uin == 'C' and uout == 'F': data = data * 1.8 + 32.0 - return '%.1f' % (data) + u'°' + uout + return '%.1f' % data + u'°' + uout if utype == 'pressure': if uin == 'mb' and uout == 'in': data = data / 33.863886666667 @@ -59,9 +59,9 @@ def units(self, utype, uin, data): elif uin == 'mm' and uout == 'in': data = data / 25.4 if uout == 'mm' or uout == 'mb' or uout == 'hPa': - return '%.1f' % (data) + uout + return '%.1f' % data + uout else: - return '%.2f' % (data) + uout + return '%.2f' % data + uout if utype == 'direction': if uin == 'deg' and uout == 'dir': return Compass.findHeading(data, 3).abbr @@ -76,7 +76,7 @@ def units(self, utype, uin, data): data = data * 0.44704 elif (uin == 'mps' or uin == 'm/s') and uout == 'mph': data = data / 0.44704 - return '%.1f' % (data) + uout + return '%.1f' % data + uout def humidity(self, temp, dew): h = 100.0 * (math.exp((17.625 * dew) / (243.04 + dew)) / @@ -94,13 +94,13 @@ def feelsLike(self, temp, dew, wind): hi = (-42.379 + 2.04901523 * t + 10.14333127 * h - .22475541 * t * h - .00683783 * t * t - .05481717 * h * h + .00122874 * t * t * h + .00085282 * t * h * h - .00000199 * t * t * h * h) - if h < 0.13 and t >= 80.0 and t <= 112.0: - hi -= ((13 - h) / 4) * math.sqrt((17 - math.abs(t - 95)) / 17) - if h > 0.85 and t >= 80.0 and t <= 112.0: + if h < 0.13 and 80.0 <= t <= 112.0: + hi -= ((13 - h) / 4) * math.sqrt((17 - abs(t - 95)) / 17) + if h > 0.85 and 80.0 <= t <= 112.0: hi += ((h - 85) / 10) * ((87 - t) / 5) return self.units('temperature', 'F', hi) if t < 50 and w >= 3: wc = 35.74 + 0.6215 * t - 35.75 * \ - (w ** 0.16) + 0.4275 * t * (w ** 0.16) + (w ** 0.16) + 0.4275 * t * (w ** 0.16) return self.units('temperature', 'F', wc) return self.units('temperature', 'F', t) diff --git a/PyQtPiClock3.py b/PyQtPiClock3.py index bb28cb3..c5ccfa0 100644 --- a/PyQtPiClock3.py +++ b/PyQtPiClock3.py @@ -1,13 +1,11 @@ -import os -import sys -import logging import logging.handlers - -from PiClock3.PiClock3 import PiClock3 -from PiClock3.Config import Config +import sys from PyQt5.QtWidgets import QMessageBox, QApplication +from PiClock3.Config import Config +from PiClock3.PiClock3 import PiClock3 + class LogHandler(logging.handlers.RotatingFileHandler): def __init__(self, *args, **kwargs): From 3382508166f3ffd69a605ac437d1121cce68128f Mon Sep 17 00:00:00 2001 From: Brendan Curley <17364941+SerBrynden@users.noreply.github.com> Date: Fri, 1 Dec 2023 10:44:35 -0700 Subject: [PATCH 02/13] Error handling for METAR pressure --- PiClock3/Metar/Metar.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PiClock3/Metar/Metar.py b/PiClock3/Metar/Metar.py index 164dd61..25891d2 100644 --- a/PiClock3/Metar/Metar.py +++ b/PiClock3/Metar/Metar.py @@ -310,8 +310,9 @@ def gotMetar(self): 'temperature', 'C', f.temp.value('C'))) - self.pressure.setText(self.piclock.language('pressure') + ' ' + - self.wxcommon.units('pressure', 'mb', f.press.value('MB'))) + if f.press: + self.pressure.setText(self.piclock.language('pressure') + ' ' + + self.wxcommon.units('pressure', 'mb', f.press.value('MB'))) self.humidity.setText(self.piclock.language('humidity') + ' ' + self.wxcommon.humidity(f.temp.value('C'), f.dewpt.value('C'))) ws = self.piclock.language('wind') From 86fcb3147f3d16c98abcf2808dfd642b971dafbd Mon Sep 17 00:00:00 2001 From: Brendan Curley <17364941+SerBrynden@users.noreply.github.com> Date: Fri, 1 Dec 2023 10:44:59 -0700 Subject: [PATCH 03/13] Added requirements.txt file --- requirements.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..537f31c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +tzlocal>=5.2 +metar>=1.11.0 +astral>=3.2 +pyyaml-include>=1.3.1 +compassheadinglib>=2021.1.7 From 648bfcea29e86b147214bcc9a842d1c1bf9f89de Mon Sep 17 00:00:00 2001 From: Brendan Curley <17364941+SerBrynden@users.noreply.github.com> Date: Fri, 1 Dec 2023 11:04:30 -0700 Subject: [PATCH 04/13] Added requirements.txt file --- README.md | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 52379b8..378af6d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # PiClock3 -A Fancy Clock built around a monitor and a Raspberry Pi and python3 + pyqt5 +A Fancy Clock built around a monitor and a Raspberry Pi and Python3 + PyQt5 ![PiClock Picture](https://raw.githubusercontent.com/n0bel/PiClock/master/Pictures/20150307_222711.jpg) This project started out as a way to waste a Saturday afternoon. I had a Raspberry Pi and an extra monitor and had just taken down an analog -clock from my livingroom wall. I was contemplating getting a radio sync'ed +clock from my living room wall. I was contemplating getting a radio synced analog clock to replace it, so I didn't have to worry about it being accurate. But instead the PiClock was born. @@ -14,30 +14,40 @@ The early days and evolution of it are chronicled on my blog http://n0bel.net/v1/index.php/projects/raspberry-pi-clock PiClock3 is a complete rewrite of PiClock (https://github.com/n0bel/PiClock). -It is based on python3 and PyQt5. It is also much more modular and less monolithic. +It is based on Python3 and PyQt5. It is also much more modular and less monolithic. At this point, this is a rough preview of the direction being taken for PiClock3. -For something useful that works use the original PiClock (https://github.com/n0bel/PiClock) +For something useful that works, use this fork of PiClock (https://github.com/SerBrynden/PiClock) It is still being updated. -On-going updates to this will be https://github.com/n0bel/PiClock/issues/230 +Ongoing updates to this will be https://github.com/n0bel/PiClock/issues/230 -I'll be commiting many partially complete commits here as an easy means to +I'll be committing many partially complete commits here as an easy means to distribute code my PiClocks for testing. No detailed instructions have been created. Basic information follows. +1. On GitHub.com, navigate to the main page of the repository: [PiClock3](../) +2. Above the list of files, click the **< > Code** button. +3. Copy the HTTPS URL for the repository. It'll look something like this: +https://github.com/USERNAME/PiClock3.git +4. Log into your Pi, (either on the screen or via ssh) (NOT as root). +You'll be in the home directory of the user pi (/home/pi) by default, +and this is where you want to be. +5. Download PiClock3 using the `git clone` command followed by the +HTTPS URL for the repository, for example: + +``` +git clone https://github.com/USERNAME/PiClock3.git +``` PiOS as of 2021-10-30 (bullseye) ``` +cd PiClock3 +sudo apt update sudo apt install python3-pyqt5 sudo apt install python3-yaml -sudo pip3 install pyyaml-include -sudo pip3 install astral -sudo pip3 install tzlocal -sudo pip3 install compassheadinglib -sudo pip3 install metar -git clone https://github.com/n0bel/PiClock3.git -cd PiClock3 +python3 -m pip install --upgrade pip +python3 -m pip install -r requirements.txt cp Config-Example.yaml Config.yaml cp ApiKeys-Example.yaml ApiKeys.yaml python3 PyQtPiClock3.py @@ -45,7 +55,7 @@ python3 PyQtPiClock3.py ### Currently Completed Plugins * Clock (Analog, Digital plugins) -* Sunrise/sunset/moonphase (Astral plugin) +* Sunrise/sunset/moon phase (Astral plugin) * Date at the top (Date plugin) * Current conditions (METAR plugin only) @@ -60,7 +70,7 @@ python3 PyQtPiClock3.py * DarkSky * Climacell * Open-Meteo -* Current Condions Plugin +* Current Conditions Plugin * Open Weather Map * Dark Sky * ClimaCell From 95851e4f97d19e4de6e6d3bc5adeb1197fd08afd Mon Sep 17 00:00:00 2001 From: Brendan Curley <17364941+SerBrynden@users.noreply.github.com> Date: Fri, 1 Dec 2023 11:10:14 -0700 Subject: [PATCH 05/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 378af6d..8b00e1f 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ distribute code my PiClocks for testing. No detailed instructions have been created. Basic information follows. -1. On GitHub.com, navigate to the main page of the repository: [PiClock3](../) +1. On GitHub.com, navigate to the main page of the repository: [PiClock3](./) 2. Above the list of files, click the **< > Code** button. 3. Copy the HTTPS URL for the repository. It'll look something like this: https://github.com/USERNAME/PiClock3.git From 8bac339b9d60c029e1ea39f90950502334389dd3 Mon Sep 17 00:00:00 2001 From: Brendan Curley <17364941+SerBrynden@users.noreply.github.com> Date: Wed, 3 Jan 2024 10:03:58 -0700 Subject: [PATCH 06/13] Create dependabot.yml --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..91abb11 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" From 17118ef22bbafd661cbb4c93eb1496a0296e0b8b Mon Sep 17 00:00:00 2001 From: Brendan Curley <17364941+SerBrynden@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:11:17 -0700 Subject: [PATCH 07/13] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 35 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++++ .github/ISSUE_TEMPLATE/other.md | 29 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/other.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..e649f3f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Operating System** +Use command `hostnamectl` in Linux terminal window to find OS info. + - OS: [e.g. Raspberry Pi OS, Debian, Ubuntu, Windows] + - Version: [e.g. Bookworm, 12.0] + +**Python Version** +Use command `python --version` or `python3 --version` in terminal window to find Python version. +- Version: [e.g. 3.9] + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Log Output** +Copy relevant portion of error log here. Remove sensitive API keys. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..d36cbc7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[REQUEST]" +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/other.md b/.github/ISSUE_TEMPLATE/other.md new file mode 100644 index 0000000..dedc2e8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other.md @@ -0,0 +1,29 @@ +--- +name: Other +about: All other issues +title: '' +labels: '' +assignees: '' + +--- + +**Describe the problem** +A clear and concise description of your problem. + +**Operating System** +Use command `hostnamectl` in Linux terminal window to find OS info. + - OS: [e.g. Raspberry Pi OS, Debian, Ubuntu, Windows] + - Version: [e.g. Bookworm, 12.0] + +**Python Version** +Use command `python --version` or `python3 --version` in terminal window to find Python version. +- Version: [e.g. 3.9] + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Log Output** +Copy relevant portion of error log here. Remove sensitive API keys. + +**Additional context** +Add any other context about the problem here. From d05cd3765557bd39cd282cecce0267db8e6a7b8b Mon Sep 17 00:00:00 2001 From: Brendan Curley <17364941+SerBrynden@users.noreply.github.com> Date: Sat, 21 Sep 2024 15:28:33 -0600 Subject: [PATCH 08/13] Update tzlocal min version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 537f31c..3c4c728 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -tzlocal>=5.2 +tzlocal>=5.1 metar>=1.11.0 astral>=3.2 pyyaml-include>=1.3.1 From a3dba20e073accb4ee4ff95e17a4e526add845b0 Mon Sep 17 00:00:00 2001 From: Brendan Curley <17364941+SerBrynden@users.noreply.github.com> Date: Tue, 17 Dec 2024 06:33:52 -0700 Subject: [PATCH 09/13] Update README.md --- README.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/README.md b/README.md index 8b00e1f..8fecb1c 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,4 @@ # PiClock3 -A Fancy Clock built around a monitor and a Raspberry Pi and Python3 + PyQt5 - -![PiClock Picture](https://raw.githubusercontent.com/n0bel/PiClock/master/Pictures/20150307_222711.jpg) - -This project started out as a way to waste a Saturday afternoon. -I had a Raspberry Pi and an extra monitor and had just taken down an analog -clock from my living room wall. I was contemplating getting a radio synced -analog clock to replace it, so I didn't have to worry about it being accurate. - -But instead the PiClock was born. - -The early days and evolution of it are chronicled on my -blog http://n0bel.net/v1/index.php/projects/raspberry-pi-clock - PiClock3 is a complete rewrite of PiClock (https://github.com/n0bel/PiClock). It is based on Python3 and PyQt5. It is also much more modular and less monolithic. From a70c235aaf345687dca8b56d260adf5cbb732918 Mon Sep 17 00:00:00 2001 From: Brendan Curley <17364941+SerBrynden@users.noreply.github.com> Date: Mon, 19 Jan 2026 19:15:35 -0700 Subject: [PATCH 10/13] Update requirements.txt --- requirements.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3c4c728..08ef8b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -tzlocal>=5.1 -metar>=1.11.0 -astral>=3.2 -pyyaml-include>=1.3.1 -compassheadinglib>=2021.1.7 +tzlocal~=5.1 +metar~=1.11.0 +astral~=3.2 +pyyaml-include~=1.3.1 +compassheadinglib~=2021.1.7 From c792ea79127b6f0e3f8761defa3306e41993a7cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 23:09:52 +0000 Subject: [PATCH 11/13] Update tzlocal requirement from ~=5.1 to ~=5.3 Updates the requirements on [tzlocal](https://github.com/regebro/tzlocal) to permit the latest version. - [Changelog](https://github.com/regebro/tzlocal/blob/master/CHANGES.txt) - [Commits](https://github.com/regebro/tzlocal/compare/5.1...5.3.1) --- updated-dependencies: - dependency-name: tzlocal dependency-version: 5.3.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 08ef8b2..8e8753d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -tzlocal~=5.1 +tzlocal~=5.3 metar~=1.11.0 astral~=3.2 pyyaml-include~=1.3.1 From 2ed0529df9ea467e0e83670369ba3b7c998ab727 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 23:09:57 +0000 Subject: [PATCH 12/13] Update pyyaml-include requirement from ~=1.3.1 to ~=2.2.0 Updates the requirements on [pyyaml-include](https://github.com/tanbro/pyyaml-include) to permit the latest version. - [Changelog](https://github.com/tanbro/pyyaml-include/blob/main/CHANGELOG.md) - [Commits](https://github.com/tanbro/pyyaml-include/compare/v1.3.1...v2.2) --- updated-dependencies: - dependency-name: pyyaml-include dependency-version: '2.2' dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 08ef8b2..19b61ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ tzlocal~=5.1 metar~=1.11.0 astral~=3.2 -pyyaml-include~=1.3.1 +pyyaml-include~=2.2.0 compassheadinglib~=2021.1.7 From 593225cb34a6874dad8677df61cb24d4a1161da3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 16:03:43 +0000 Subject: [PATCH 13/13] Update compassheadinglib requirement from ~=2021.1.7 to ~=2026.1.22 Updates the requirements on [compassheadinglib](https://github.com/Peter-E-Lenz/compassheadinglib) to permit the latest version. - [Commits](https://github.com/Peter-E-Lenz/compassheadinglib/compare/v2021.1.7...v2026.1.22) --- updated-dependencies: - dependency-name: compassheadinglib dependency-version: 2026.1.22 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 30ef617..e9a7d6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ tzlocal~=5.3 metar~=1.11.0 astral~=3.2 pyyaml-include~=2.2.0 -compassheadinglib~=2021.1.7 +compassheadinglib~=2026.1.22