From ac6d4d40cdf7ae14fed0c2874cf10973aa6f2501 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Mon, 29 Sep 2025 20:57:17 +0100 Subject: [PATCH] Remove colours from API #7 --- core/constants.py | 34 +++++++++++++++++----------------- data/band.py | 6 +----- data/spot.py | 6 ------ webassets/apidocs/openapi.yml | 8 -------- 4 files changed, 18 insertions(+), 36 deletions(-) diff --git a/core/constants.py b/core/constants.py index 380a243..523060a 100644 --- a/core/constants.py +++ b/core/constants.py @@ -12,23 +12,23 @@ ALL_MODES = CW_MODES + PHONE_MODES + DATA_MODES # Band definitions BANDS = [ - Band(name="160m", start_freq=1800, end_freq=2000, color="#7cfc00", contrast_color="black"), - Band(name="80m", start_freq=3500, end_freq=4000, color="#e550e5", contrast_color="black"), - Band(name="60m", start_freq=5250, end_freq=5410, color="#00008b", contrast_color="white"), - Band(name="40m", start_freq=7000, end_freq=7300, color="#5959ff", contrast_color="white"), - Band(name="30m", start_freq=10100, end_freq=10150, color="#62d962", contrast_color="black"), - Band(name="20m", start_freq=14000, end_freq=14350, color="#f2c40c", contrast_color="black"), - Band(name="17m", start_freq=18068, end_freq=18168, color="#f2f261", contrast_color="black"), - Band(name="15m", start_freq=21000, end_freq=21450, color="#cca166", contrast_color="black"), - Band(name="12m", start_freq=24890, end_freq=24990, color="#b22222", contrast_color="white"), - Band(name="10m", start_freq=28000, end_freq=29700, color="#ff69b4", contrast_color="black"), - Band(name="6m", start_freq=50000, end_freq=54000, color="#FF0000", contrast_color="white"), - Band(name="4m", start_freq=70000, end_freq=70500, color="#cc0044", contrast_color="white"), - Band(name="2m", start_freq=144000, end_freq=148000, color="#FF1493", contrast_color="black"), - Band(name="70cm", start_freq=420000, end_freq=450000, color="#999900", contrast_color="white"), - Band(name="23cm", start_freq=1240000, end_freq=1325000, color="#5AB8C7", contrast_color="black"), - Band(name="13cm", start_freq=2300000, end_freq=2450000, color="#FF7F50", contrast_color="black")] -UNKNOWN_BAND = Band(name="Unknown", start_freq=0, end_freq=0, color="black", contrast_color="white") + Band(name="160m", start_freq=1800, end_freq=2000), + Band(name="80m", start_freq=3500, end_freq=4000), + Band(name="60m", start_freq=5250, end_freq=5410), + Band(name="40m", start_freq=7000, end_freq=7300), + Band(name="30m", start_freq=10100, end_freq=10150), + Band(name="20m", start_freq=14000, end_freq=14350), + Band(name="17m", start_freq=18068, end_freq=18168), + Band(name="15m", start_freq=21000, end_freq=21450), + Band(name="12m", start_freq=24890, end_freq=24990), + Band(name="10m", start_freq=28000, end_freq=29700), + Band(name="6m", start_freq=50000, end_freq=54000), + Band(name="4m", start_freq=70000, end_freq=70500), + Band(name="2m", start_freq=144000, end_freq=148000), + Band(name="70cm", start_freq=420000, end_freq=450000), + Band(name="23cm", start_freq=1240000, end_freq=1325000), + Band(name="13cm", start_freq=2300000, end_freq=2450000)] +UNKNOWN_BAND = Band(name="Unknown", start_freq=0, end_freq=0) # DXCC flags (borrowed from https:#github.com/wavelog/wavelog/blob/master/application/libraries/DxccFlag.php) DXCC_FLAGS = { diff --git a/data/band.py b/data/band.py index e57a790..df4b432 100644 --- a/data/band.py +++ b/data/band.py @@ -8,8 +8,4 @@ class Band: # Start frequency, in kHz start_freq: float # Stop frequency, in kHz - end_freq: float - # Colour to use for this band, as per PSK Reporter - color: str - # Contrast colour to use for text against a background of the band colour - contrast_color: str \ No newline at end of file + end_freq: float \ No newline at end of file diff --git a/data/spot.py b/data/spot.py index 4b4b323..ee89290 100644 --- a/data/spot.py +++ b/data/spot.py @@ -55,10 +55,6 @@ class Spot: freq: float = None # Band, defined by the frequency, e.g. "40m" or "70cm" band: str = None - # Colour to use for the band - band_color: str = None - # Contrast colour to use for text on a background of band_color - band_contrast_color: str = None # Time of the spot time: datetime = None # Time that this software received the spot. This is used with the "since_received" call to our API to receive all @@ -121,8 +117,6 @@ class Spot: if self.freq and not self.band: band = infer_band_from_freq(self.freq) self.band = band.name - self.band_color = band.color - self.band_contrast_color = band.contrast_color # Mode from comments, mode family from mode if self.comment and not self.mode: diff --git a/webassets/apidocs/openapi.yml b/webassets/apidocs/openapi.yml index 704e583..97994a1 100644 --- a/webassets/apidocs/openapi.yml +++ b/webassets/apidocs/openapi.yml @@ -362,14 +362,6 @@ components: - 13cm - Unknown example: 40m - band_color: - type: string - description: Colour to use for the band - example: "#aaaaff" - band_contrast_color: - type: string - description: Contrast colour to use for text on a background of band_color - example: black time: type: string description: Time of the spot, ISO 8601 format