Skip to content

Commit

Permalink
Adjust zda to handle new da for Light.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwood committed Mar 22, 2024
1 parent 9faae42 commit eaeb676
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 25 deletions.
4 changes: 2 additions & 2 deletions enumerate_device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func Test_enumerateDevice_runRules(t *testing.T) {
ProfileID: zigbee.ProfileHomeAutomation,
DeviceID: 0x0400,
DeviceVersion: 1,
InClusterList: []zigbee.ClusterID{0x0008},
InClusterList: []zigbee.ClusterID{0x0006, 0x0008},
},
},
},
Expand All @@ -246,7 +246,7 @@ func Test_enumerateDevice_runRules(t *testing.T) {
assert.NoError(t, err)

assert.Contains(t, outEnv.endpoints[zigbee.Endpoint(10)].rulesOutput.Capabilities, "ZCLOnOff")
assert.Contains(t, outEnv.endpoints[zigbee.Endpoint(20)].rulesOutput.Capabilities, "ZCLLevel")
assert.Contains(t, outEnv.endpoints[zigbee.Endpoint(20)].rulesOutput.Capabilities, "ZCLLight")
})
}

Expand Down
41 changes: 18 additions & 23 deletions rules/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"Capabilities": {
"Add": {
"ZCLPowerSupply": {
"ZigbeeClusterID": "Fn.ClusterID(0x0001)",
"ZigbeePowerClusterID": "Fn.ClusterID(0x0001)",
"ZigbeeEndpoint": "Fn.Endpoint(Self)"
}
}
Expand All @@ -35,35 +35,30 @@
"Capabilities": {
"Add": {
"ZCLOnOff": {
"ZigbeeClusterID": "Fn.ClusterID(0x0006)",
"ZigbeeOnOffClusterID": "Fn.ClusterID(0x0006)",
"ZigbeeEndpoint": "Fn.Endpoint(Self)"
}
}
}
}
},
{
"Filter": "(0x0008 in Endpoint[Self].InClusters)",
"Filter": "(0x0006 in Endpoint[Self].InClusters) && ((0x0300 in Endpoint[Self].InClusters) || (0x0008 in Endpoint[Self].InClusters))",
"Actions": {
"Capabilities": {
"Add": {
"ZCLLevel": {
"ZigbeeClusterID": "Fn.ClusterID(0x0008)",
"ZigbeeEndpoint": "Fn.Endpoint(Self)"
}
}
}
}
},
{
"Filter": "(0x0300 in Endpoint[Self].InClusters)",
"Actions": {
"Capabilities": {
"Add": {
"ZCLColor": {
"ZigbeeClusterID": "Fn.ClusterID(0x0200)",
"ZCLLight": {
"ZigbeeOnOffClusterPresent": "(0x0006 in Endpoint[Self].InClusters)",
"ZigbeeOnOffClusterID": "Fn.ClusterID(0x0006)",
"ZigbeeColorClusterPresent": "(0x0300 in Endpoint[Self].InClusters)",
"ZigbeeColorClusterID": "Fn.ClusterID(0x0300)",
"ZigbeeLevelClusterPresent": "(0x0008 in Endpoint[Self].InClusters)",
"ZigbeeLevelClusterID": "Fn.ClusterID(0x0008)",
"ZigbeeEndpoint": "Fn.Endpoint(Self)"
}
},
"Remove": {
"ZCLOnOff": {}
}
}
}
Expand All @@ -74,7 +69,7 @@
"Capabilities": {
"Add": {
"ZCLTemperatureSensor": {
"ZigbeeClusterID": "Fn.ClusterID(0x0402)",
"ZigbeeTemperatureSensorClusterID": "Fn.ClusterID(0x0402)",
"ZigbeeEndpoint": "Fn.Endpoint(Self)"
}
}
Expand All @@ -87,7 +82,7 @@
"Capabilities": {
"Add": {
"ZCLPressureSensor": {
"ZigbeeClusterID": "Fn.ClusterID(0x0404)",
"ZigbeePressureSensorClusterID": "Fn.ClusterID(0x0404)",
"ZigbeeEndpoint": "Fn.Endpoint(Self)"
}
}
Expand All @@ -100,7 +95,7 @@
"Capabilities": {
"Add": {
"ZCLHumiditySensor": {
"ZigbeeClusterID": "Fn.ClusterID(0x0405)",
"ZigbeeHumiditySensorClusterID": "Fn.ClusterID(0x0405)",
"ZigbeeEndpoint": "Fn.Endpoint(Self)"
}
}
Expand All @@ -113,7 +108,7 @@
"Capabilities": {
"Add": {
"ZCLAlarmSensor": {
"ZigbeeClusterID": "Fn.ClusterID(0x0500)",
"ZigbeeAlarmSensorClusterID": "Fn.ClusterID(0x0500)",
"ZigbeeEndpoint": "Fn.Endpoint(Self)"
}
}
Expand All @@ -126,7 +121,7 @@
"Capabilities": {
"Add": {
"ZCLAlarmWarningDevice": {
"ZigbeeClusterID": "Fn.ClusterID(0x0502)",
"ZigbeeAlarmWarningDeviceClusterID": "Fn.ClusterID(0x0502)",
"ZigbeeEndpoint": "Fn.Endpoint(Self)"
}
}
Expand Down

0 comments on commit eaeb676

Please sign in to comment.