Station Health Rules

A file to store health transition rules for station.

class StationHealthRules(*args, **kwargs)

A class to handle transition rules for station.

property default_thresholds: dict[str, float]

Get the default thresholds for this device.

Returns:

the default thresholds

degraded_rule(field_station_health, sps_station_health, antenna_healths)

Test whether DEGRADED is valid for the station.

Parameters:
  • field_station_health (HealthState | None) – health of the FieldStation

  • sps_station_health (HealthState | None) – health of the SpsStation

  • antenna_healths (dict[str, HealthState | None]) – dictionary of antenna healths

Return type:

bool

Returns:

True if DEGRADED is a valid state

failed_rule(field_station_health, sps_station_health, antenna_healths)

Test whether FAILED is valid for the station.

Parameters:
  • field_station_health (HealthState | None) – health of the FieldStation

  • sps_station_health (HealthState | None) – health of the SpsStation

  • antenna_healths (dict[str, HealthState | None]) – dictionary of antenna healths

Return type:

bool

Returns:

True if FAILED is a valid state

healthy_rule(field_station_health, sps_station_health, antenna_healths)

Test whether OK is valid for the station.

Parameters:
  • field_station_health (HealthState | None) – health of the FieldStation

  • sps_station_health (HealthState | None) – health of the SpsStation

  • antenna_healths (dict[str, HealthState | None]) – dictionary of antenna healths

Return type:

bool

Returns:

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

unknown_rule(field_station_health, sps_station_health, antenna_healths)

Test whether UNKNOWN is valid for the station.

Parameters:
  • field_station_health (HealthState | None) – health of the FieldStation

  • sps_station_health (HealthState | None) – health of the SpsStation

  • antenna_healths (dict[str, HealthState | None]) – dictionary of antenna healths

Return type:

bool

Returns:

True if UNKNOWN is a valid state