Skip to content

Commit

Permalink
fix(ignore): remove all ubisys custom cluster/attributes (#1034)
Browse files Browse the repository at this point in the history
* fix(ignore): remove all ubisys custom cluster/attributes

* tests: uses non ubisys attributes
  • Loading branch information
sjorge authored May 4, 2024
1 parent 44235eb commit 0e54023
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 90 deletions.
63 changes: 0 additions & 63 deletions src/zcl/definition/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,20 +521,6 @@ const Clusters: Readonly<Record<ClusterName, Readonly<ClusterDefinition>>> = {
defaultMoveRate: {ID: 20, type: DataType.UINT16},
startUpCurrentLevel: {ID: 16384, type: DataType.UINT8},
elkoStartUpCurrentLevel: {ID: 0x4000, type: DataType.UINT8, manufacturerCode: ManufacturerCode.ADEO},
ubisysMinimumOnLevel: {ID: 0x0000, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysValveType: {ID: 0x0001, type: DataType.BITMAP8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysCyclePeriod: {ID: 0x0002, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysSeason: {ID: 0x0003, type: DataType.ENUM8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysBackupLevel: {ID: 0x0004, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysAlternateBackupLevel: {ID: 0x0005, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysLowerRange: {ID: 0x0006, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysUpperRange: {ID: 0x0007, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysPumpThresholdOn: {ID: 0x0008, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysPumpThresholdOff: {ID: 0x0009, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysHeatingDemandEnableThreshold: {ID: 0x000A, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysHeatingDemandDisableThreshold: {ID: 0x000B, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysCoolingDemandEnableThreshold: {ID: 0x000C, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysCoolingDemandDisableThreshold: {ID: 0x000D, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
},
commands: {
moveToLevel: {
Expand Down Expand Up @@ -1814,14 +1800,6 @@ const Clusters: Readonly<Record<ClusterName, Readonly<ClusterDefinition>>> = {
windowCoveringMode: {ID: 23, type: DataType.BITMAP8},
intermediateSetpointsLift: {ID: 24, type: DataType.OCTET_STR},
intermediateSetpointsTilt: {ID: 25, type: DataType.OCTET_STR},
ubisysTurnaroundGuardTime: {ID: 0x1000, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysLiftToTiltTransitionSteps: {ID: 0x1001, type: DataType.UINT16, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysTotalSteps: {ID: 0x1002, type: DataType.UINT16, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysLiftToTiltTransitionSteps2: {ID: 0x1003, type: DataType.UINT16, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysTotalSteps2: {ID: 0x1004, type: DataType.UINT16, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysAdditionalSteps: {ID: 0x1005, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysInactivePowerThreshold: {ID: 0x1006, type: DataType.UINT16, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysStartupSteps: {ID: 0x1007, type: DataType.UINT16, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
tuyaMovingState: {ID: 0xf000, type: DataType.ENUM8},
tuyaCalibration: {ID: 0xf001, type: DataType.ENUM8},
stepPositionLift: {ID: 0xf001, type: DataType.ENUM8, manufacturerCode: ManufacturerCode.LEGRAND_GROUP},
Expand Down Expand Up @@ -2057,22 +2035,6 @@ const Clusters: Readonly<Record<ClusterName, Readonly<ClusterDefinition>>> = {
elkoLastMessageStatus: {ID: 0x0419, type: DataType.UINT8},
fourNoksHysteresisHigh: {ID: 0x0101, type: DataType.UINT16, manufacturerCode: ManufacturerCode.ASTREL_GROUP_SRL},
fourNoksHysteresisLow: {ID: 0x0102, type: DataType.UINT16, manufacturerCode: ManufacturerCode.ASTREL_GROUP_SRL},
ubisysClassBTemperatureOffset: {ID: 0x0000, type: DataType.INT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysReturnFlowTemperatureWeight: {ID: 0x0001, type: DataType.INT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysRawOutdoorTemperature: {ID: 0x0002, type: DataType.STRUCT, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysRawLocalTemperatureA: {ID: 0x0003, type: DataType.STRUCT, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysRawLocalTemperatureB: {ID: 0x0004, type: DataType.STRUCT, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysRawForwardFlowTemperature: {ID: 0x0005, type: DataType.STRUCT, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysRawReturnFlowTemperature: {ID: 0x0006, type: DataType.STRUCT, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysInstalledExtensions: {ID: 0x0007, type: DataType.BITMAP64, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysTemperatureOffset: {ID: 0x0010, type: DataType.INT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysDefaultOccupiedHeatingSetpoint: {ID: 0x0011, type: DataType.INT16, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysVacationMode: {ID: 0x0012, type: DataType.BOOLEAN, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysRemoteTemperature: {ID: 0x0013, type: DataType.INT16, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysRemoteTemperatureValidDuration: {ID: 0x0014, type: DataType.UINT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysProportionalGain: {ID: 0x0020, type: DataType.INT16, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysProportionalShift: {ID: 0x0021, type: DataType.INT8, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
ubisysIntegralFactor: {ID: 0x0022, type: DataType.INT16, manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH},
},
commands: {
setpointRaiseLower: {
Expand Down Expand Up @@ -4297,31 +4259,6 @@ const Clusters: Readonly<Record<ClusterName, Readonly<ClusterDefinition>>> = {
commandsResponse: {
},
},
manuSpecificUbisysDeviceSetup: {
ID: 0xfc00,
// Doesn't use manufacturerCode: https://github.com/Koenkk/zigbee-herdsman-converters/pull/4412
attributes: {
inputConfigurations: {ID: 0x0000, type: DataType.ARRAY},
inputActions: {ID: 0x0001, type: DataType.ARRAY},
},
commands: {
},
commandsResponse: {
}
},
manuSpecificUbisysDimmerSetup: {
ID: 0xfc01,
manufacturerCode: ManufacturerCode.UBISYS_TECHNOLOGIES_GMBH,
attributes: {
capabilities: {ID: 0x0000, type: DataType.BITMAP8},
status: {ID: 0x0001, type: DataType.BITMAP8},
mode: {ID: 0x0002, type: DataType.BITMAP8},
},
commands: {
},
commandsResponse: {
}
},
manuSpecificLegrandDevices: {
ID: 0xfc01,
manufacturerCode: ManufacturerCode.LEGRAND_GROUP,
Expand Down
4 changes: 2 additions & 2 deletions src/zcl/definition/tstype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type ClusterName = (
| 'telecommunicationsChatting' | 'haApplianceIdentification' | 'haMeterIdentification' | 'haApplianceEventsAlerts' | 'haApplianceStatistics'
| 'haElectricalMeasurement' | 'haDiagnostic' | 'touchlink' | 'manuSpecificIkeaAirPurifier' | 'msIkeaVocIndexMeasurement'
| 'manuSpecificClusterAduroSmart' | 'manuSpecificOsram' | 'manuSpecificPhilips' | 'manuSpecificPhilips2' | 'manuSpecificSinope'
| 'manuSpecificUbisysDeviceSetup' | 'manuSpecificUbisysDimmerSetup' | 'manuSpecificLegrandDevices' | 'manuSpecificLegrandDevices2'
| 'manuSpecificLegrandDevices' | 'manuSpecificLegrandDevices2'
| 'manuSpecificLegrandDevices3' | 'manuSpecificNiko1' | 'manuSpecificNiko2' | 'wiserDeviceInfo' | 'manuSpecificTuya' | 'manuSpecificLumi'
| 'liXeePrivate' | 'manuSpecificTuya_2' | 'manuSpecificTuya_3' | 'manuSpecificCentraliteHumidity' | 'manuSpecificSmartThingsArrivalSensor'
| 'manuSpecificSamsungAccelerometer' | 'heimanSpecificFormaldehydeMeasurement' | 'heimanSpecificAirQuality' | 'heimanSpecificScenes'
Expand All @@ -71,4 +71,4 @@ type ClusterName = (

export {
ParameterDefinition, ClusterDefinition, AttributeDefinition, CommandDefinition, ClusterName, CustomClusters,
};
};
20 changes: 10 additions & 10 deletions test/controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,7 @@ describe('Controller', () => {
const endpoint = device.getEndpoint(1);
mocksendZclFrameToEndpoint.mockClear();
await endpoint.configureReporting('hvacThermostat', [{
attribute: 'ubisysVacationMode',
attribute: 'viessmannWindowOpenInternal',
minimumReportInterval: 1,
maximumReportInterval: 10,
reportableChange: 1,
Expand All @@ -2955,10 +2955,10 @@ describe('Controller', () => {
expect(call[0]).toBe('0x129');
expect(call[1]).toBe(129);
expect(call[2]).toBe(1)
expect({...deepClone(call[3]), cluster: {}}).toStrictEqual({"cluster":{},"command":{"ID":6,"name":"configReport","parameters":[{"name":"direction","type":32},{"name":"attrId","type":33},{"conditions":[{"type":"directionEquals","value":0}],"name":"dataType","type":32},{"conditions":[{"type":"directionEquals","value":0}],"name":"minRepIntval","type":33},{"conditions":[{"type":"directionEquals","value":0}],"name":"maxRepIntval","type":33},{"conditions":[{"type":"directionEquals","value":0},{"type":"dataTypeValueTypeEquals","value":"ANALOG"}],"name":"repChange","type":1000},{"conditions":[{"type":"directionEquals","value":1}],"name":"timeout","type":33}],"response":7},"header":{"commandIdentifier":6,"frameControl":{"direction":0,"disableDefaultResponse":true,"frameType":0,"manufacturerSpecific":true,"reservedBits":0},"manufacturerCode":4338,"transactionSequenceNumber":11},"payload":[{"attrId":18,"dataType":16,"direction":0,"maxRepIntval":10,"minRepIntval":1,"repChange":1}]});
expect({...deepClone(call[3]), cluster: {}}).toStrictEqual({"cluster":{},"command":{"ID":6,"name":"configReport","parameters":[{"name":"direction","type":32},{"name":"attrId","type":33},{"conditions":[{"type":"directionEquals","value":0}],"name":"dataType","type":32},{"conditions":[{"type":"directionEquals","value":0}],"name":"minRepIntval","type":33},{"conditions":[{"type":"directionEquals","value":0}],"name":"maxRepIntval","type":33},{"conditions":[{"type":"directionEquals","value":0},{"type":"dataTypeValueTypeEquals","value":"ANALOG"}],"name":"repChange","type":1000},{"conditions":[{"type":"directionEquals","value":1}],"name":"timeout","type":33}],"response":7},"header":{"commandIdentifier":6,"frameControl":{"direction":0,"disableDefaultResponse":true,"frameType":0,"manufacturerSpecific":true,"reservedBits":0},"manufacturerCode":4641,"transactionSequenceNumber":11},"payload":[{"attrId":16384,"dataType":48,"direction":0,"maxRepIntval":10,"minRepIntval":1,"repChange":1}]});

expect(endpoint.configuredReportings.length).toBe(1);
expect({...endpoint.configuredReportings[0], cluster: undefined}).toStrictEqual({"attribute":{"ID":18,"type":16,"manufacturerCode":4338,"name":"ubisysVacationMode"},"minimumReportInterval":1,"maximumReportInterval":10,"reportableChange":1, "cluster": undefined});
expect({...endpoint.configuredReportings[0], cluster: undefined}).toStrictEqual({"attribute":{"ID":16384,"type":48,"manufacturerCode":4641,"name":"viessmannWindowOpenInternal"},"minimumReportInterval":1,"maximumReportInterval":10,"reportableChange":1, "cluster": undefined});
});

it('Endpoint configure reporting with manufacturer attribute should throw exception', async () => {
Expand All @@ -2978,7 +2978,7 @@ describe('Controller', () => {
reportableChange: 1,
},
{
attribute: 'ubisysRemoteTemperature',
attribute: 'viessmannWindowOpenInternal',
minimumReportInterval: 1,
maximumReportInterval: 10,
reportableChange: 1,
Expand Down Expand Up @@ -3352,13 +3352,13 @@ describe('Controller', () => {
const device = controller.getDeviceByIeeeAddr('0x129');
device._manufacturerID = 0x10f2;
const endpoint = device.getEndpoint(1);
await endpoint.write('hvacThermostat', {'ubisysDefaultOccupiedHeatingSetpoint': 1800});
await endpoint.write('hvacThermostat', {'viessmannWindowOpenInternal': 1});
expect(mocksendZclFrameToEndpoint).toBeCalledTimes(1);
const call = mocksendZclFrameToEndpoint.mock.calls[0];
expect(call[0]).toBe('0x129');
expect(call[1]).toBe(129);
expect(call[2]).toBe(1);
expect({...deepClone(call[3]), cluster: {}}).toStrictEqual({"header":{"frameControl":{"reservedBits":0,"frameType":0,"direction":0,"disableDefaultResponse":true,"manufacturerSpecific":true},"transactionSequenceNumber":11,"manufacturerCode":4338,"commandIdentifier":2},"payload":[{"attrId":17,"attrData":1800,"dataType":41}],"cluster":{},"command":{"ID":2,"name":"write","parameters":[{"name":"attrId","type":33},{"name":"dataType","type":32},{"name":"attrData","type":1000}],"response":4}});
expect({...deepClone(call[3]), cluster: {}}).toStrictEqual({"header":{"frameControl":{"reservedBits":0,"frameType":0,"direction":0,"disableDefaultResponse":true,"manufacturerSpecific":true},"transactionSequenceNumber":11,"manufacturerCode":4641,"commandIdentifier":2},"payload":[{"attrId":16384,"attrData":1,"dataType":48}],"cluster":{},"command":{"ID":2,"name":"write","parameters":[{"name":"attrId","type":33},{"name":"dataType","type":32},{"name":"attrData","type":1000}],"response":4}});
expect(call[4]).toBe(10000);
});

Expand Down Expand Up @@ -3399,7 +3399,7 @@ describe('Controller', () => {
device._manufacturerID = 0x10f2;
const endpoint = device.getEndpoint(1);
let error;
try {await endpoint.write('hvacThermostat', {'occupiedHeatingSetpoint': 2000, 'ubisysDefaultOccupiedHeatingSetpoint': 1800}) } catch (e) {error = e}
try {await endpoint.write('hvacThermostat', {'occupiedHeatingSetpoint': 2000, 'viessmannWindowOpenInternal': 1}) } catch (e) {error = e}
expect(error).toStrictEqual(new Error("Cannot have attributes with different manufacturerCode in single 'write' call"))
});

Expand Down Expand Up @@ -3505,13 +3505,13 @@ describe('Controller', () => {
const device = controller.getDeviceByIeeeAddr('0x129');
device._manufacturerID = 0x10f2;
const endpoint = device.getEndpoint(1);
await endpoint.read('hvacThermostat', ['ubisysDefaultOccupiedHeatingSetpoint']);
await endpoint.read('hvacThermostat', ['viessmannWindowOpenInternal']);
expect(mocksendZclFrameToEndpoint).toBeCalledTimes(1);
const call = mocksendZclFrameToEndpoint.mock.calls[0];
expect(call[0]).toBe('0x129');
expect(call[1]).toBe(129);
expect(call[2]).toBe(1);
expect({...deepClone(call[3]), cluster: {}}).toStrictEqual({"header":{"frameControl":{"reservedBits":0,"frameType":0,"direction":0,"disableDefaultResponse":true,"manufacturerSpecific":true},"transactionSequenceNumber":11,"manufacturerCode":4338,"commandIdentifier":0},"payload":[{"attrId":17}],"cluster":{},"command":{"ID":0,"name":"read","parameters":[{"name":"attrId","type":33}],"response":1}});
expect({...deepClone(call[3]), cluster: {}}).toStrictEqual({"header":{"frameControl":{"reservedBits":0,"frameType":0,"direction":0,"disableDefaultResponse":true,"manufacturerSpecific":true},"transactionSequenceNumber":11,"manufacturerCode":4641,"commandIdentifier":0},"payload":[{"attrId":16384}],"cluster":{},"command":{"ID":0,"name":"read","parameters":[{"name":"attrId","type":33}],"response":1}});
expect(call[4]).toBe(10000);
});

Expand All @@ -3523,7 +3523,7 @@ describe('Controller', () => {
device._manufacturerID = 0x10f2;
const endpoint = device.getEndpoint(1);
let error;
try { await endpoint.read('hvacThermostat', ['localTemp', 'ubisysRemoteTemperature']); } catch (e) { error = e };
try { await endpoint.read('hvacThermostat', ['localTemp', 'viessmannWindowOpenInternal']); } catch (e) { error = e };
expect(error).toStrictEqual(new Error("Cannot have attributes with different manufacturerCode in single 'read' call"))
});

Expand Down
Loading

0 comments on commit 0e54023

Please sign in to comment.