mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[copybara] Resync with mostrobotpy (#8662)
This commit is contained in:
@@ -17,9 +17,7 @@ def group_name(request):
|
||||
AlertSim.resetData()
|
||||
|
||||
|
||||
def get_active_alerts(
|
||||
group_name: str, level: Alert.Level
|
||||
) -> T.List[str]:
|
||||
def get_active_alerts(group_name: str, level: Alert.Level) -> T.List[str]:
|
||||
return [
|
||||
a.text
|
||||
for a in AlertSim.getAll()
|
||||
@@ -27,13 +25,14 @@ def get_active_alerts(
|
||||
]
|
||||
|
||||
|
||||
def is_alert_active(
|
||||
group_name: str, text: str, level: Alert.Level
|
||||
):
|
||||
def is_alert_active(group_name: str, text: str, level: Alert.Level):
|
||||
matches = [
|
||||
a
|
||||
for a in AlertSim.getAll()
|
||||
if a.group == group_name and a.level == level and a.text == text and a.isActive()
|
||||
if a.group == group_name
|
||||
and a.level == level
|
||||
and a.text == text
|
||||
and a.isActive()
|
||||
]
|
||||
return len(matches) > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user