feat: report facts, not warnings (0.2.0)
CI / test (3.10) (push) Successful in 5m27s
CI / test (3.11) (push) Successful in 5m24s
CI / test (3.12) (push) Successful in 5m23s
CI / test (3.10) (pull_request) Successful in 5m26s
CI / test (3.11) (pull_request) Successful in 5m18s
CI / test (3.12) (pull_request) Successful in 5m21s

Drop get_device_warnings. The DSL noise margin and the firmware on offer
are already facts in get_system_config (dsl_downstream_noise_margin,
firmware_update_available, firmware_version); netOrk derives
dsl_snr_low and firmware_update_available from them (netOrk #1111).
This commit is contained in:
Christian Manivong committed 2026-10-17 09:32:57 +02:00
1 parent c6a51f730f
commit ec3e1e9028
3 files changed
+6 -62

No files matched your search

-33
View File
@@ -395,39 +395,6 @@ class FritzBoxDriver(ResidentialGatewayDriver):
return result
def get_device_warnings(self) -> list[dict[str, Any]]:
"""Return device warnings derived from DSL line quality and firmware state.
Called during the poll cycle via ``_collect_system_snapshots``.
Reads ``UserInterface1`` for firmware updates and
``WANDSLInterfaceConfig1`` for line quality.
"""
warnings: list[dict[str, Any]] = []
available = self.fc.services if self.fc else {}
if "UserInterface1" in available:
try:
ui_info = self._call("UserInterface1", "X_AVM-DE_GetInfo")
if ui_info.get("NewX_AVM-DE_UpdateState", "") == "Available":
warnings.append({
"code": "firmware_update_available",
"meta": {"latest_version": ui_info.get("NewX_AVM-DE_Version", "")},
})
except _OPTIONAL_SERVICE_ERRORS:
pass
if "WANDSLInterfaceConfig1" in available:
try:
info = self._call("WANDSLInterfaceConfig1", "GetInfo")
# SNR margin is in dB×10; < 60 means < 6 dB — borderline line quality
snr_down = int(_to_float(info.get("NewDownstreamNoiseMargin")))
if 0 < snr_down < 60:
warnings.append({"code": "dsl_snr_low", "meta": {"snr_db_x10": snr_down}})
except _OPTIONAL_SERVICE_ERRORS:
pass
return warnings
def get_arp_table(self, vrf: str = "") -> list[dict[str, Any]]:
"""Return the ARP table, derived from :meth:`get_hosts`.