From 9ca1a8a51c62dd522ec7b6db29e75e0f23a14ab8 Mon Sep 17 00:00:00 2001 From: sparky8512 <76499194+sparky8512@users.noreply.github.com> Date: Sat, 19 Feb 2022 16:16:54 -0800 Subject: [PATCH] Remove valid check from obstruction status data Remove the validity check that was gating the reporting of the obstruction_duration and obstruction_interval data items. When that got added to the grpc protocol, I assumed that the valid flag meant whether the other 2 fields were useful data. That may actually have been the intent, for all I know, but I've never seen that flag report true. However, I also never saw the banner in the app telling me I would get obstructions every X minutes, either. That is, until a few weeks ago, probably due to a dish firmware change. Now I see the app reporting this data, so it must be ignoring that valid flag, or at least not using it for that purpose. Probably nobody cares about this data (including me), given that nobody ever complained about it always reporting empty values, but I don't want to remove it and mess up db schemas, so it might as well be populated. --- starlink_grpc.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/starlink_grpc.py b/starlink_grpc.py index 7437552..d26f566 100644 --- a/starlink_grpc.py +++ b/starlink_grpc.py @@ -618,12 +618,8 @@ def status_data(context=None): if field.number < 65: alert_bits |= (1 if value else 0) << (field.number - 1) - if status.obstruction_stats.avg_prolonged_obstruction_valid: - obstruction_duration = status.obstruction_stats.avg_prolonged_obstruction_duration_s - obstruction_interval = status.obstruction_stats.avg_prolonged_obstruction_interval_s - else: - obstruction_duration = None - obstruction_interval = None + obstruction_duration = status.obstruction_stats.avg_prolonged_obstruction_duration_s + obstruction_interval = status.obstruction_stats.avg_prolonged_obstruction_interval_s return { "id": status.device_info.id,