Skip to content

Commit

Permalink
Add ResourceItems for device OTA firmware (#7961)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebaauw authored Nov 8, 2024
1 parent ca13ec8 commit 9da501c
Show file tree
Hide file tree
Showing 37 changed files with 516 additions and 0 deletions.
9 changes: 9 additions & 0 deletions devices/dresden_elektronik/hive.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion"
},
Expand Down
9 changes: 9 additions & 0 deletions devices/dresden_elektronik/kobold.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion"
},
Expand Down
18 changes: 18 additions & 0 deletions devices/fireangel/co_alarm.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion",
"parse": {
Expand Down Expand Up @@ -119,6 +128,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion",
"parse": {
Expand Down
18 changes: 18 additions & 0 deletions devices/fireangel/generic_alarm.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion",
"parse": {
Expand Down Expand Up @@ -119,6 +128,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion",
"parse": {
Expand Down
18 changes: 18 additions & 0 deletions devices/fireangel/smoke_alarm.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion",
"parse": {
Expand Down Expand Up @@ -119,6 +128,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion",
"parse": {
Expand Down
16 changes: 16 additions & 0 deletions devices/generic/items/cap_otau_file_version_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"schema": "resourceitem1.schema.json",
"id": "cap/otau/file_version",
"datatype": "UInt32",
"access": "R",
"public": true,
"implicit": false,
"description": "Firmware file version.",
"parse": {
"fn": "zcl:cmd",
"ep": 255,
"cl": "0x0019",
"cmd": "0x01",
"eval": "if (ZclFrame.payloadSize >= 9) Item.val = ZclFrame.at(8) << 24 | ZclFrame.at(7) << 16 | ZclFrame.at(6) << 8 | ZclFrame.at(5)"
}
}
16 changes: 16 additions & 0 deletions devices/generic/items/cap_otau_image_type_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"schema": "resourceitem1.schema.json",
"id": "cap/otau/image_type",
"datatype": "UInt16",
"access": "R",
"public": true,
"implicit": false,
"description": "Firmware image type.",
"parse": {
"fn": "zcl:cmd",
"ep": 255,
"cl": "0x0019",
"cmd": "0x01",
"eval": "if (ZclFrame.payloadSize >= 9) Item.val = ZclFrame.at(4) << 8 | ZclFrame.at(3)"
}
}
25 changes: 25 additions & 0 deletions devices/generic/items/cap_otau_manufacturer_code_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"schema": "resourceitem1.schema.json",
"id": "cap/otau/manufacturer_code",
"datatype": "UInt16",
"access": "R",
"public": true,
"implicit": false,
"description": "Firmware manufacturer code.",
"parse": {
"fn": "zcl:cmd",
"ep": 255,
"cl": "0x0019",
"cmd": "0x01",
"eval": "if (ZclFrame.payloadSize >= 9) Item.val = ZclFrame.at(2) << 8 | ZclFrame.at(1)"
},
"read": {
"fn": "zcl:cmd",
"ep": 255,
"fc": "0x19",
"cl": "0x0019",
"cmd": "0x00",
"eval": "'0064'"
},
"refresh.interval": 86400
}
9 changes: 9 additions & 0 deletions devices/icasa/ICZB-IW11D.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion"
},
Expand Down
27 changes: 27 additions & 0 deletions devices/icasa/ICZB-IW21D.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion"
},
Expand Down Expand Up @@ -131,6 +140,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion"
},
Expand Down Expand Up @@ -191,6 +209,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion"
},
Expand Down
9 changes: 9 additions & 0 deletions devices/icasa/ICZB-IW21SW.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion"
},
Expand Down
9 changes: 9 additions & 0 deletions devices/ikea/tradfri_driver_30w.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/productid",
"parse": {
Expand Down
27 changes: 27 additions & 0 deletions devices/innr/sp_240.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion"
},
Expand Down Expand Up @@ -82,6 +91,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion"
},
Expand Down Expand Up @@ -139,6 +157,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/swversion"
},
Expand Down
11 changes: 11 additions & 0 deletions devices/philips/light_zb3_C.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"LCL003",
"LCL006",
"LCU001",
"LCV001",
"1746447P7",
"4080248P9",
"5063130P7",
Expand Down Expand Up @@ -100,6 +101,7 @@
"LCL003",
"LCL006",
"LCU001",
"LCV001",
"1746447P7",
"4080248P9",
"5063130P7",
Expand Down Expand Up @@ -181,6 +183,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/productid"
},
Expand Down
9 changes: 9 additions & 0 deletions devices/philips/light_zb3_C_festavia.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/productid"
},
Expand Down
9 changes: 9 additions & 0 deletions devices/philips/light_zb3_C_gradient.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@
{
"name": "attr/name"
},
{
"name": "cap/otau/file_version"
},
{
"name": "cap/otau/image_type"
},
{
"name": "cap/otau/manufacturer_code"
},
{
"name": "attr/productid"
},
Expand Down
Loading

0 comments on commit 9da501c

Please sign in to comment.