Skip to content

Commit

Permalink
Release 2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Luligu committed Mar 28, 2024
1 parent e65390a commit 434873c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matterbridge-zigbee2mqtt",
"version": "2.0.3",
"version": "2.0.4",
"description": "Matterbridge zigbee2mqtt plugin",
"author": "https://github.com/Luligu",
"license": "Apache-2.0",
Expand Down Expand Up @@ -55,7 +55,11 @@
"dev:link": "npm link --save-dev matterbridge",
"dev:install": "npm install --save-dev matterbridge",
"dev:uninstall": "npm uninstall matterbridge && npm unlink matterbridge",
"install": "node link-matterbridge-script.js"
"install": "node link-matterbridge-script.js",
"version": "npm run build",
"version:patch": "npm version patch",
"version:minor": "npm version minor",
"version:major": "npm version major"
},
"devDependencies": {
"@stylistic/eslint-plugin": "^1.7.0",
Expand Down
6 changes: 4 additions & 2 deletions src/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class ZigbeeEntity extends EventEmitter {
this.log.debug(`Setting accessory ${this.ien}${this.accessoryName}${rs}${db} airQuality: ${airQuality}`);
}
if (key === 'voc') {
this.bridgedDevice.getClusterServerById(TvocMeasurement.Cluster.id)?.setMeasuredValueAttribute(value);
this.bridgedDevice.getClusterServerById(TvocMeasurement.Cluster.id)?.setMeasuredValueAttribute(Math.min(65535, value));
this.log.debug(`Setting accessory ${this.ien}${this.accessoryName}${rs}${db} measuredValue: ${value}`);
}
if (key === 'occupancy') {
Expand Down Expand Up @@ -322,7 +322,7 @@ const z2ms: ZigbeeToMatter[] = [
{ type: '', name: 'air_quality', property: 'air_quality', deviceType: airQualitySensor, cluster: AirQuality.Cluster.id, attribute: AirQuality.Cluster.attributes.airQuality.id },
{ type: '', name: 'voc', property: 'voc', deviceType: airQualitySensor, cluster: TvocMeasurement.Cluster.id, attribute: TvocMeasurement.Cluster.attributes.measuredValue.id },
{ type: '', name: 'action', property: 'action', deviceType: DeviceTypes.GENERIC_SWITCH, cluster: Switch.Cluster.id, attribute: Switch.Cluster.attributes.currentPosition.id },
{ type: '', name: 'transmit_power', property: 'transmit_power', deviceType: DeviceTypes.DOOR_LOCK, cluster: DoorLock.Cluster.id, attribute: DoorLock.Cluster.attributes.lockState.id },
//{ type: '', name: 'transmit_power', property: 'transmit_power', deviceType: DeviceTypes.DOOR_LOCK, cluster: DoorLock.Cluster.id, attribute: DoorLock.Cluster.attributes.lockState.id },
];
/* eslint-enable */

Expand All @@ -331,6 +331,8 @@ export class ZigbeeDevice extends ZigbeeEntity {
super(platform, device);
if (device.friendly_name === 'Coordinator') {
this.bridgedDevice = new BridgedBaseDevice(this, DeviceTypes.DOOR_LOCK, [Identify.Cluster.id, DoorLock.Cluster.id]);
} else if (device.model_id === 'ti.router' && device.manufacturer === 'TexasInstruments') {
this.bridgedDevice = new BridgedBaseDevice(this, DeviceTypes.DOOR_LOCK, [Identify.Cluster.id, DoorLock.Cluster.id]);
}

// Get types and properties
Expand Down
2 changes: 1 addition & 1 deletion src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
private async requestDeviceUpdate(device: BridgeDevice) {
this.log.debug(`Requesting update for ${device.friendly_name} model_id: ${device.model_id} manufacturer: ${device.manufacturer}`);
const payload: Payload = {};
if (!device.definition || !device.definition.exposes) return;
if (device.power_source === 'Battery' || !device.definition || !device.definition.exposes) return;
for (const feature of device.definition.exposes) {
if (feature.features) {
for (const subFeature of feature.features) {
Expand Down

0 comments on commit 434873c

Please sign in to comment.