Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 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.
Expand Down
1 change: 0 additions & 1 deletion custom_components/pymc_repeater/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/pymc_repeater/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.1.1"
}
7 changes: 2 additions & 5 deletions custom_components/pymc_repeater/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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:
Expand Down
12 changes: 11 additions & 1 deletion custom_components/pymc_repeater/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down