Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend genBasic support #1282

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/zspec/zcl/definition/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ export const Clusters: Readonly<Record<ClusterName, Readonly<ClusterDefinition>>
dateCode: {ID: 6, type: DataType.CHAR_STR},
powerSource: {ID: 7, type: DataType.ENUM8},
appProfileVersion: {ID: 8, type: DataType.ENUM8},
swBuildId: {ID: 16384, type: DataType.CHAR_STR},
genericDeviceType: {ID: 9, type: DataType.ENUM8},
productCode: {ID: 10, type: DataType.OCTET_STR},
productUrl: {ID: 11, type: DataType.CHAR_STR},
manufacturerVersionDetails: {ID: 12, type: DataType.CHAR_STR},
serialNumber: {ID: 13, type: DataType.CHAR_STR},
productLabel: {ID: 14, type: DataType.CHAR_STR},
locationDesc: {ID: 16, type: DataType.CHAR_STR},
physicalEnv: {ID: 17, type: DataType.ENUM8},
deviceEnabled: {ID: 18, type: DataType.BOOLEAN},
alarmMask: {ID: 19, type: DataType.BITMAP8},
disableLocalConfig: {ID: 20, type: DataType.BITMAP8},
swBuildId: {ID: 0x4000, type: DataType.CHAR_STR},
schneiderMeterRadioPower: {ID: 0xe200, type: DataType.INT8, manufacturerCode: ManufacturerCode.SCHNEIDER_ELECTRIC},
},
commands: {
Expand Down
81 changes: 63 additions & 18 deletions test/controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4632,21 +4632,26 @@ describe('Controller', () => {
attributes: {
zclVersion: {ID: 0, type: 32, name: 'zclVersion'},
appVersion: {ID: 1, type: 32, name: 'appVersion'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
stackVersion: {ID: 2, type: 32, name: 'stackVersion'},
hwVersion: {ID: 3, type: 32, name: 'hwVersion'},
manufacturerName: {ID: 4, type: 66, name: 'manufacturerName'},
modelId: {ID: 5, type: 66, name: 'modelId'},
dateCode: {ID: 6, type: 66, name: 'dateCode'},
powerSource: {ID: 7, type: 48, name: 'powerSource'},
appProfileVersion: {ID: 8, type: 48, name: 'appProfileVersion'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
genericDeviceType: {ID: 9, type: 48, name: 'genericDeviceType'},
productCode: {ID: 10, type: 65, name: 'productCode'},
productUrl: {ID: 11, type: 66, name: 'productUrl'},
manufacturerVersionDetails: {ID: 12, type: 66, name: 'manufacturerVersionDetails'},
serialNumber: {ID: 13, type: 66, name: 'serialNumber'},
productLabel: {ID: 14, type: 66, name: 'productLabel'},
locationDesc: {ID: 16, type: 66, name: 'locationDesc'},
physicalEnv: {ID: 17, type: 48, name: 'physicalEnv'},
deviceEnabled: {ID: 18, type: 16, name: 'deviceEnabled'},
alarmMask: {ID: 19, type: 24, name: 'alarmMask'},
disableLocalConfig: {ID: 20, type: 24, name: 'disableLocalConfig'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
},
name: 'genBasic',
commands: {
Expand Down Expand Up @@ -6142,21 +6147,26 @@ describe('Controller', () => {
attributes: {
zclVersion: {ID: 0, type: 32, name: 'zclVersion'},
appVersion: {ID: 1, type: 32, name: 'appVersion'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
stackVersion: {ID: 2, type: 32, name: 'stackVersion'},
hwVersion: {ID: 3, type: 32, name: 'hwVersion'},
manufacturerName: {ID: 4, type: 66, name: 'manufacturerName'},
modelId: {ID: 5, type: 66, name: 'modelId'},
dateCode: {ID: 6, type: 66, name: 'dateCode'},
powerSource: {ID: 7, type: 48, name: 'powerSource'},
appProfileVersion: {ID: 8, type: 48, name: 'appProfileVersion'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
genericDeviceType: {ID: 9, type: 48, name: 'genericDeviceType'},
productCode: {ID: 10, type: 65, name: 'productCode'},
productUrl: {ID: 11, type: 66, name: 'productUrl'},
manufacturerVersionDetails: {ID: 12, type: 66, name: 'manufacturerVersionDetails'},
serialNumber: {ID: 13, type: 66, name: 'serialNumber'},
productLabel: {ID: 14, type: 66, name: 'productLabel'},
locationDesc: {ID: 16, type: 66, name: 'locationDesc'},
physicalEnv: {ID: 17, type: 48, name: 'physicalEnv'},
deviceEnabled: {ID: 18, type: 16, name: 'deviceEnabled'},
alarmMask: {ID: 19, type: 24, name: 'alarmMask'},
disableLocalConfig: {ID: 20, type: 24, name: 'disableLocalConfig'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
},
name: 'genBasic',
commands: {
Expand Down Expand Up @@ -6249,21 +6259,26 @@ describe('Controller', () => {
attributes: {
zclVersion: {ID: 0, type: 32, name: 'zclVersion'},
appVersion: {ID: 1, type: 32, name: 'appVersion'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
stackVersion: {ID: 2, type: 32, name: 'stackVersion'},
hwVersion: {ID: 3, type: 32, name: 'hwVersion'},
manufacturerName: {ID: 4, type: 66, name: 'manufacturerName'},
modelId: {ID: 5, type: 66, name: 'modelId'},
dateCode: {ID: 6, type: 66, name: 'dateCode'},
powerSource: {ID: 7, type: 48, name: 'powerSource'},
appProfileVersion: {ID: 8, type: 48, name: 'appProfileVersion'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
genericDeviceType: {ID: 9, type: 48, name: 'genericDeviceType'},
productCode: {ID: 10, type: 65, name: 'productCode'},
productUrl: {ID: 11, type: 66, name: 'productUrl'},
manufacturerVersionDetails: {ID: 12, type: 66, name: 'manufacturerVersionDetails'},
serialNumber: {ID: 13, type: 66, name: 'serialNumber'},
productLabel: {ID: 14, type: 66, name: 'productLabel'},
locationDesc: {ID: 16, type: 66, name: 'locationDesc'},
physicalEnv: {ID: 17, type: 48, name: 'physicalEnv'},
deviceEnabled: {ID: 18, type: 16, name: 'deviceEnabled'},
alarmMask: {ID: 19, type: 24, name: 'alarmMask'},
disableLocalConfig: {ID: 20, type: 24, name: 'disableLocalConfig'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
},
name: 'genBasic',
commands: {
Expand Down Expand Up @@ -6342,21 +6357,26 @@ describe('Controller', () => {
attributes: {
zclVersion: {ID: 0, type: 32, name: 'zclVersion'},
appVersion: {ID: 1, type: 32, name: 'appVersion'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
stackVersion: {ID: 2, type: 32, name: 'stackVersion'},
hwVersion: {ID: 3, type: 32, name: 'hwVersion'},
manufacturerName: {ID: 4, type: 66, name: 'manufacturerName'},
modelId: {ID: 5, type: 66, name: 'modelId'},
dateCode: {ID: 6, type: 66, name: 'dateCode'},
powerSource: {ID: 7, type: 48, name: 'powerSource'},
appProfileVersion: {ID: 8, type: 48, name: 'appProfileVersion'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
genericDeviceType: {ID: 9, type: 48, name: 'genericDeviceType'},
productCode: {ID: 10, type: 65, name: 'productCode'},
productUrl: {ID: 11, type: 66, name: 'productUrl'},
manufacturerVersionDetails: {ID: 12, type: 66, name: 'manufacturerVersionDetails'},
serialNumber: {ID: 13, type: 66, name: 'serialNumber'},
productLabel: {ID: 14, type: 66, name: 'productLabel'},
locationDesc: {ID: 16, type: 66, name: 'locationDesc'},
physicalEnv: {ID: 17, type: 48, name: 'physicalEnv'},
deviceEnabled: {ID: 18, type: 16, name: 'deviceEnabled'},
alarmMask: {ID: 19, type: 24, name: 'alarmMask'},
disableLocalConfig: {ID: 20, type: 24, name: 'disableLocalConfig'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
},
name: 'genBasic',
commands: {
Expand Down Expand Up @@ -6449,21 +6469,26 @@ describe('Controller', () => {
attributes: {
zclVersion: {ID: 0, type: 32, name: 'zclVersion'},
appVersion: {ID: 1, type: 32, name: 'appVersion'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
stackVersion: {ID: 2, type: 32, name: 'stackVersion'},
hwVersion: {ID: 3, type: 32, name: 'hwVersion'},
manufacturerName: {ID: 4, type: 66, name: 'manufacturerName'},
modelId: {ID: 5, type: 66, name: 'modelId'},
dateCode: {ID: 6, type: 66, name: 'dateCode'},
powerSource: {ID: 7, type: 48, name: 'powerSource'},
appProfileVersion: {ID: 8, type: 48, name: 'appProfileVersion'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
genericDeviceType: {ID: 9, type: 48, name: 'genericDeviceType'},
productCode: {ID: 10, type: 65, name: 'productCode'},
productUrl: {ID: 11, type: 66, name: 'productUrl'},
manufacturerVersionDetails: {ID: 12, type: 66, name: 'manufacturerVersionDetails'},
serialNumber: {ID: 13, type: 66, name: 'serialNumber'},
productLabel: {ID: 14, type: 66, name: 'productLabel'},
locationDesc: {ID: 16, type: 66, name: 'locationDesc'},
physicalEnv: {ID: 17, type: 48, name: 'physicalEnv'},
deviceEnabled: {ID: 18, type: 16, name: 'deviceEnabled'},
alarmMask: {ID: 19, type: 24, name: 'alarmMask'},
disableLocalConfig: {ID: 20, type: 24, name: 'disableLocalConfig'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
},
name: 'genBasic',
commands: {
Expand Down Expand Up @@ -6527,21 +6552,26 @@ describe('Controller', () => {
attributes: {
zclVersion: {ID: 0, type: 32, name: 'zclVersion'},
appVersion: {ID: 1, type: 32, name: 'appVersion'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
stackVersion: {ID: 2, type: 32, name: 'stackVersion'},
hwVersion: {ID: 3, type: 32, name: 'hwVersion'},
manufacturerName: {ID: 4, type: 66, name: 'manufacturerName'},
modelId: {ID: 5, type: 66, name: 'modelId'},
dateCode: {ID: 6, type: 66, name: 'dateCode'},
powerSource: {ID: 7, type: 48, name: 'powerSource'},
appProfileVersion: {ID: 8, type: 48, name: 'appProfileVersion'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
genericDeviceType: {ID: 9, type: 48, name: 'genericDeviceType'},
productCode: {ID: 10, type: 65, name: 'productCode'},
productUrl: {ID: 11, type: 66, name: 'productUrl'},
manufacturerVersionDetails: {ID: 12, type: 66, name: 'manufacturerVersionDetails'},
serialNumber: {ID: 13, type: 66, name: 'serialNumber'},
productLabel: {ID: 14, type: 66, name: 'productLabel'},
locationDesc: {ID: 16, type: 66, name: 'locationDesc'},
physicalEnv: {ID: 17, type: 48, name: 'physicalEnv'},
deviceEnabled: {ID: 18, type: 16, name: 'deviceEnabled'},
alarmMask: {ID: 19, type: 24, name: 'alarmMask'},
disableLocalConfig: {ID: 20, type: 24, name: 'disableLocalConfig'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
},
name: 'genBasic',
commands: {
Expand Down Expand Up @@ -6625,21 +6655,26 @@ describe('Controller', () => {
attributes: {
zclVersion: {ID: 0, type: 32, name: 'zclVersion'},
appVersion: {ID: 1, type: 32, name: 'appVersion'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
stackVersion: {ID: 2, type: 32, name: 'stackVersion'},
hwVersion: {ID: 3, type: 32, name: 'hwVersion'},
manufacturerName: {ID: 4, type: 66, name: 'manufacturerName'},
modelId: {ID: 5, type: 66, name: 'modelId'},
dateCode: {ID: 6, type: 66, name: 'dateCode'},
powerSource: {ID: 7, type: 48, name: 'powerSource'},
appProfileVersion: {ID: 8, type: 48, name: 'appProfileVersion'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
genericDeviceType: {ID: 9, type: 48, name: 'genericDeviceType'},
productCode: {ID: 10, type: 65, name: 'productCode'},
productUrl: {ID: 11, type: 66, name: 'productUrl'},
manufacturerVersionDetails: {ID: 12, type: 66, name: 'manufacturerVersionDetails'},
serialNumber: {ID: 13, type: 66, name: 'serialNumber'},
productLabel: {ID: 14, type: 66, name: 'productLabel'},
locationDesc: {ID: 16, type: 66, name: 'locationDesc'},
physicalEnv: {ID: 17, type: 48, name: 'physicalEnv'},
deviceEnabled: {ID: 18, type: 16, name: 'deviceEnabled'},
alarmMask: {ID: 19, type: 24, name: 'alarmMask'},
disableLocalConfig: {ID: 20, type: 24, name: 'disableLocalConfig'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
},
name: 'genBasic',
commands: {
Expand Down Expand Up @@ -6677,21 +6712,26 @@ describe('Controller', () => {
attributes: {
zclVersion: {ID: 0, type: 32, name: 'zclVersion'},
appVersion: {ID: 1, type: 32, name: 'appVersion'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
stackVersion: {ID: 2, type: 32, name: 'stackVersion'},
hwVersion: {ID: 3, type: 32, name: 'hwVersion'},
manufacturerName: {ID: 4, type: 66, name: 'manufacturerName'},
modelId: {ID: 5, type: 66, name: 'modelId'},
dateCode: {ID: 6, type: 66, name: 'dateCode'},
powerSource: {ID: 7, type: 48, name: 'powerSource'},
appProfileVersion: {ID: 8, type: 48, name: 'appProfileVersion'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
genericDeviceType: {ID: 9, type: 48, name: 'genericDeviceType'},
productCode: {ID: 10, type: 65, name: 'productCode'},
productUrl: {ID: 11, type: 66, name: 'productUrl'},
manufacturerVersionDetails: {ID: 12, type: 66, name: 'manufacturerVersionDetails'},
serialNumber: {ID: 13, type: 66, name: 'serialNumber'},
productLabel: {ID: 14, type: 66, name: 'productLabel'},
locationDesc: {ID: 16, type: 66, name: 'locationDesc'},
physicalEnv: {ID: 17, type: 48, name: 'physicalEnv'},
deviceEnabled: {ID: 18, type: 16, name: 'deviceEnabled'},
alarmMask: {ID: 19, type: 24, name: 'alarmMask'},
disableLocalConfig: {ID: 20, type: 24, name: 'disableLocalConfig'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
},
name: 'genBasic',
commands: {
Expand Down Expand Up @@ -8663,21 +8703,26 @@ describe('Controller', () => {
attributes: {
zclVersion: {ID: 0, type: 32, name: 'zclVersion'},
appVersion: {ID: 1, type: 32, name: 'appVersion'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
stackVersion: {ID: 2, type: 32, name: 'stackVersion'},
hwVersion: {ID: 3, type: 32, name: 'hwVersion'},
manufacturerName: {ID: 4, type: 66, name: 'manufacturerName'},
modelId: {ID: 5, type: 66, name: 'modelId'},
dateCode: {ID: 6, type: 66, name: 'dateCode'},
powerSource: {ID: 7, type: 48, name: 'powerSource'},
appProfileVersion: {ID: 8, type: 48, name: 'appProfileVersion'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
genericDeviceType: {ID: 9, type: 48, name: 'genericDeviceType'},
productCode: {ID: 10, type: 65, name: 'productCode'},
productUrl: {ID: 11, type: 66, name: 'productUrl'},
manufacturerVersionDetails: {ID: 12, type: 66, name: 'manufacturerVersionDetails'},
serialNumber: {ID: 13, type: 66, name: 'serialNumber'},
productLabel: {ID: 14, type: 66, name: 'productLabel'},
locationDesc: {ID: 16, type: 66, name: 'locationDesc'},
physicalEnv: {ID: 17, type: 48, name: 'physicalEnv'},
deviceEnabled: {ID: 18, type: 16, name: 'deviceEnabled'},
alarmMask: {ID: 19, type: 24, name: 'alarmMask'},
disableLocalConfig: {ID: 20, type: 24, name: 'disableLocalConfig'},
swBuildId: {ID: 16384, type: 66, name: 'swBuildId'},
schneiderMeterRadioPower: {ID: 57856, manufacturerCode: 4190, name: 'schneiderMeterRadioPower', type: 40},
},
name: 'genBasic',
commands: {
Expand Down
Loading