meta-romulus: fan-control: Handle service failures

Handle dependent service failures:
1. When ambient temperature is unavailable, set default floor speed;
2. When occ services are unavailable, set to max speed.

Tested: Verify that the default floor speed is set when outlet temp
        sensor is missing;
        Verify that the max speed is set when occ service is killed;
        With https://gerrit.openbmc-project.xyz/#/c/9584/, verify that
        the floor speed is set back according to outlet temp when the
        sensor and occ service are back.

Change-Id: I395f99ac8a6e76fdeb11a189294b096ee6256b76
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/meta-romulus/recipes-phosphor/fans/phosphor-fan-control-events-config-native/events.yaml b/meta-romulus/recipes-phosphor/fans/phosphor-fan-control-events-config-native/events.yaml
index 967a0b7..ddf1556 100644
--- a/meta-romulus/recipes-phosphor/fans/phosphor-fan-control-events-config-native/events.yaml
+++ b/meta-romulus/recipes-phosphor/fans/phosphor-fan-control-events-config-native/events.yaml
@@ -221,6 +221,60 @@
           - delta
 
 events:
+    - name: default_fan_floor_on_service_fail
+      groups:
+          - name: zone0_ambient
+            interface: xyz.openbmc_project.Sensor.Value
+            property:
+                name: Value
+                type: int64_t
+      matches:
+          - name: nameOwnerChanged
+      actions:
+          - name: call_actions_based_on_timer
+            timer:
+                delay: 5
+                type: oneshot
+            actions:
+                - name: default_floor_on_missing_owner
+    - name: high_speed_on_occ0_service_fail
+      groups:
+          - name: occ0_object
+            interface: org.open_power.OCC.Status
+            property:
+                name: OccActive
+                type: bool
+      matches:
+          - name: nameOwnerChanged
+      actions:
+          - name: call_actions_based_on_timer
+            timer:
+                delay: 5
+                type: oneshot
+            actions:
+                - name: set_speed_on_missing_owner
+                  speed:
+                      value: 255
+                      type: uint64_t
+    - name: high_speed_on_occ1_service_fail
+      groups:
+          - name: occ1_object
+            interface: org.open_power.OCC.Status
+            property:
+                name: OccActive
+                type: bool
+      matches:
+          - name: nameOwnerChanged
+      actions:
+          - name: call_actions_based_on_timer
+            timer:
+                delay: 5
+                type: oneshot
+            actions:
+                - name: set_speed_on_missing_owner
+                  speed:
+                      value: 255
+                      type: uint64_t
     - name: missing_before_high_speed_air
       groups:
           - name: air_cooled_zone0_fans