Complete the code to acknowledge an alarm by setting its status to acknowledged.
alarm.status = '[1]'
Setting the alarm status to acknowledged marks it as recognized by the operator.
Complete the code to check if an alarm is acknowledged before clearing it.
if alarm.status == '[1]': clear_alarm(alarm)
Only alarms that are acknowledged should be cleared to ensure they were seen.
Fix the error in the code to update the alarm acknowledgment timestamp correctly.
alarm.ack_time = datetime.[1]()The now() method returns the current local date and time, suitable for acknowledgment timestamp.
Fill both blanks to create a function that acknowledges an alarm and logs the action.
def acknowledge_alarm(alarm): alarm.status = '[1]' alarm.ack_time = datetime.[2]() log_action('Alarm acknowledged')
The function sets the alarm status to acknowledged and records the current local time with now().
Fill all three blanks to filter alarms that are active and not yet acknowledged.
unack_alarms = [alarm for alarm in alarms if alarm.status == '[1]' and not alarm.[2] and alarm.priority [3] 3]
This list comprehension selects alarms with status active, that are not acknowledged, and have priority less than or equal to 3.