From 4058f58acf42822c6d1ef9b4e8bd7206a9990cf0 Mon Sep 17 00:00:00 2001 From: Yellowcooln <12516003+yellowcooln@users.noreply.github.com> Date: Fri, 8 May 2026 14:16:12 -0400 Subject: [PATCH 1/2] Stop polling GitHub update channels --- CHANGELOG.md | 6 ++++++ custom_components/pymc_repeater/api.py | 1 - custom_components/pymc_repeater/manifest.json | 2 +- custom_components/pymc_repeater/select.py | 7 ++----- custom_components/pymc_repeater/sensor.py | 12 +++++++++++- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39b9f30..342eca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.0.3 + +- stopped polling GitHub branch data every 60 seconds by removing `update_channels` from the normal integration refresh loop +- kept update status polling local to the repeater while making the update channel UI use a local fallback list instead of live GitHub branch fetches +- reduces unnecessary GitHub API traffic and avoids rate limiting caused by routine Home Assistant polling + ## 1.0.0 Initial stable release of the pyMC Repeater Home Assistant integration. diff --git a/custom_components/pymc_repeater/api.py b/custom_components/pymc_repeater/api.py index 392450c..8df3269 100644 --- a/custom_components/pymc_repeater/api.py +++ b/custom_components/pymc_repeater/api.py @@ -141,7 +141,6 @@ async def async_fetch_all(self) -> dict[str, Any]: "transport_keys": self.async_get_transport_keys(), "room_stats": self.async_get_room_stats(), "update_status": self.async_get_update_status(), - "update_channels": self.async_get_update_channels(), "companions": self.async_get_companions(), "gps": self.async_get_gps(), } diff --git a/custom_components/pymc_repeater/manifest.json b/custom_components/pymc_repeater/manifest.json index b54a7ba..2d24c41 100644 --- a/custom_components/pymc_repeater/manifest.json +++ b/custom_components/pymc_repeater/manifest.json @@ -10,5 +10,5 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/pyMC-dev/pyMC-HA-Integration/issues", "requirements": [], - "version": "1.1.0" + "version": "1.0.3" } diff --git a/custom_components/pymc_repeater/select.py b/custom_components/pymc_repeater/select.py index d02091c..2cb86cc 100644 --- a/custom_components/pymc_repeater/select.py +++ b/custom_components/pymc_repeater/select.py @@ -9,7 +9,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from .const import DOMAIN -from .sensor import PyMCBaseEntity, _nested +from .sensor import PyMCBaseEntity, _nested, _update_channel_options MODE_OPTIONS = ["forward", "monitor", "no_tx"] @@ -65,10 +65,7 @@ def __init__(self, entry: ConfigEntry, coordinator, api) -> None: @property def options(self) -> list[str]: - channels = _nested(self.coordinator.data, "update_channels", "channels") - if isinstance(channels, list) and channels: - return [str(channel) for channel in channels] - return ["main", "dev"] + return _update_channel_options(self.coordinator.data) @property def current_option(self) -> str | None: diff --git a/custom_components/pymc_repeater/sensor.py b/custom_components/pymc_repeater/sensor.py index 62cd61b..af06196 100644 --- a/custom_components/pymc_repeater/sensor.py +++ b/custom_components/pymc_repeater/sensor.py @@ -66,6 +66,16 @@ def _mqtt_connected_count(data: dict[str, Any]) -> int: return sum(1 for broker in brokers if _nested(broker, "status", "connected")) +def _update_channel_options(data: dict[str, Any]) -> list[str]: + current = _nested(data, "update_status", "channel") or _nested( + data, "update_channels", "current_channel" + ) + options = ["main", "dev"] + if isinstance(current, str) and current and current not in options: + return [current, *options] + return options + + def _transport_key_count(data: dict[str, Any]) -> int: keys = data.get("transport_keys") or [] return len(keys) if isinstance(keys, list) else 0 @@ -172,7 +182,7 @@ class PyMCSensorDescription(SensorEntityDescription): value_fn=lambda data: _nested(data, "update_status", "channel") or _nested(data, "update_channels", "current_channel"), attrs_fn=lambda data: { - "available_channels": _nested(data, "update_channels", "channels"), + "available_channels": _update_channel_options(data), }, ), PyMCSensorDescription( From 2652b7d311395fbe2a1cc22d4202b754b12cd39b Mon Sep 17 00:00:00 2001 From: Yellowcooln <12516003+yellowcooln@users.noreply.github.com> Date: Fri, 8 May 2026 14:22:16 -0400 Subject: [PATCH 2/2] Correct dev version to 1.1.1 --- CHANGELOG.md | 16 +++++++++++++++- custom_components/pymc_repeater/manifest.json | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 342eca5..364b34c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,25 @@ # Changelog -## 1.0.3 +## 1.1.1 - stopped polling GitHub branch data every 60 seconds by removing `update_channels` from the normal integration refresh loop - kept update status polling local to the repeater while making the update channel UI use a local fallback list instead of live GitHub branch fetches - reduces unnecessary GitHub API traffic and avoids rate limiting caused by routine Home Assistant polling +## 1.1.0 + +- moved the `dev` branch forward onto the `1.1.x` release line for continued development + +## 1.0.2 + +- added GPS stream support using `/api/gps_stream` for faster live GPS updates +- kept normal polling for non-GPS entities while allowing GPS entities to refresh immediately from the repeater stream + +## 1.0.1 + +- expanded GPS diagnostics from newer repeater API data +- added additional GPS state, motion, accuracy, time, and NMEA-related entities and attributes + ## 1.0.0 Initial stable release of the pyMC Repeater Home Assistant integration. diff --git a/custom_components/pymc_repeater/manifest.json b/custom_components/pymc_repeater/manifest.json index 2d24c41..8dbbf11 100644 --- a/custom_components/pymc_repeater/manifest.json +++ b/custom_components/pymc_repeater/manifest.json @@ -10,5 +10,5 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/pyMC-dev/pyMC-HA-Integration/issues", "requirements": [], - "version": "1.0.3" + "version": "1.1.1" }