wspoon: Only create/monitor fan1 on air cooled

Add a condition check for fan1 that will only create fan1 associated
functional properties and actively monitor fan1 if the condition passes.
The condition checks the CoolingType is not WaterCooled.

Tested:
    Fan1 functional properties are created when condition passes
    Fan1 is monitored when condition passes

Change-Id: I0d9a91ceea500f82e4ccad2dbdc887a14286cf95
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-monitor-config-native/monitor.yaml b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-monitor-config-native/monitor.yaml
index feda646..5db7966 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-monitor-config-native/monitor.yaml
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-monitor-config-native/monitor.yaml
@@ -20,6 +20,16 @@
         has_target: true
       - name: fan1_1
         has_target: false
+    # Create fan1 inventory & sensors on air cooled only
+    condition:
+      name: propertiesMatch
+      properties:
+        - object: /xyz/openbmc_project/inventory/system/chassis
+          interface: xyz.openbmc_project.Inventory.Decorator.CoolingType
+          property:
+              name: WaterCooled
+              type: bool
+              value: false
 
   - inventory: /system/chassis/motherboard/fan2
     functional_delay: 5
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml
index 0d179ef..01632e6 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml
@@ -13,3 +13,15 @@
                 - /system/chassis/power_supply1
                 - /system/chassis/powersupply0
                 - /system/chassis/powersupply1
+
+    - name: Remove fan1
+      description: >
+          Remove all fan1 associated objects and have fan presence and
+          fan monitor create it based on cooling type.
+      type: startup
+      actions:
+          - name: destroyObjects
+            paths:
+                - /system/chassis/motherboard/fan1/fan1_0
+                - /system/chassis/motherboard/fan1/fan1_1
+                - /system/chassis/motherboard/fan1