Station Health Rules

A file to store health transition rules for station.

class StationHealthRules(*args: Any, **kwargs: Any)[source]

A class to handle transition rules for station.

property default_thresholds: dict[str, float | bool]

Get the default thresholds for this device.

Returns:

the default thresholds

degraded_rule(field_station_health: HealthState | None, sps_station_health: HealthState | None, antenna_healths: dict[str, HealthState | None]) tuple[bool, str][source]

Test whether DEGRADED is valid for the station.

Parameters:
  • field_station_health – health of the FieldStation

  • sps_station_health – health of the SpsStation

  • antenna_healths – dictionary of antenna healths

Returns:

True if DEGRADED is a valid state

failed_rule(field_station_health: HealthState | None, sps_station_health: HealthState | None, antenna_healths: dict[str, HealthState | None]) tuple[bool, str][source]

Test whether FAILED is valid for the station.

Parameters:
  • field_station_health – health of the FieldStation

  • sps_station_health – health of the SpsStation

  • antenna_healths – dictionary of antenna healths

Returns:

True if FAILED is a valid state

healthy_rule(field_station_health: HealthState | None, sps_station_health: HealthState | None, antenna_healths: dict[str, HealthState | None]) tuple[bool, str][source]

Test whether OK is valid for the station.

Parameters:
  • field_station_health – health of the FieldStation

  • sps_station_health – health of the SpsStation

  • antenna_healths – dictionary of antenna healths

Returns:

True if OK is a valid state or if station is empty

unknown_rule(field_station_health: HealthState | None, sps_station_health: HealthState | None, antenna_healths: dict[str, HealthState | None]) tuple[bool, str][source]

Test whether UNKNOWN is valid for the station.

Parameters:
  • field_station_health – health of the FieldStation

  • sps_station_health – health of the SpsStation

  • antenna_healths – dictionary of antenna healths

Returns:

True if UNKNOWN is a valid state, along with a text report.