Zigbee-herdsman 0.8.0

This commit is contained in:
Koen Kanters
2019-10-01 20:22:47 +02:00
parent 90c70e8629
commit 518232e15e
6 changed files with 19 additions and 20 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ class DeviceConfigure extends BaseExtension {
logger.info(`Succesfully configured '${settingsDevice.friendlyName}'`);
// eslint-disable-next-line
device.meta.configured = mappedDevice.meta.configureKey;
await device.save();
device.save();
} catch (error) {
logger.error(
`Failed to configure '${settingsDevice.friendlyName}', ` +
+1 -1
View File
@@ -60,7 +60,7 @@ class DeviceReport extends BaseExtension {
);
}
await device.save();
device.save();
this.configuring.delete(device.ieeeAddr);
}
+6 -6
View File
@@ -44,9 +44,9 @@ class Groups extends BaseExtension {
}
// In zigbee but not in settings
for (const endpoint of zigbeeGroup.getMembers()) {
for (const endpoint of zigbeeGroup.members) {
if (!settingsEntity.find((e) => e.endpoint === endpoint)) {
const deviceSettings = settings.getDevice(endpoint.deviceIeeeAddress);
const deviceSettings = settings.getDevice(endpoint.getDevice().ieeeAddr);
logger.info(`Removing '${deviceSettings.friendlyName}' from group '${settingGroup.friendlyName}'`);
await endpoint.removeFromGroup(zigbeeGroup);
}
@@ -56,8 +56,8 @@ class Groups extends BaseExtension {
// eslint-disable-next-line
for (const zigbeeGroup of zigbeeGroups) {
if (!settingsGroups.find((g) => g.ID === zigbeeGroup.groupID)) {
for (const endpoint of zigbeeGroup.getMembers()) {
const deviceSettings = settings.getDevice(endpoint.deviceIeeeAddress);
for (const endpoint of zigbeeGroup.members) {
const deviceSettings = settings.getDevice(endpoint.getDevice().ieeeAddr);
logger.info(`Removing '${deviceSettings.friendlyName}' from group ${zigbeeGroup.groupID}`);
await endpoint.removeFromGroup(zigbeeGroup);
}
@@ -95,8 +95,8 @@ class Groups extends BaseExtension {
}
} else {
const groupIDsToPublish = new Set();
for (const member of entity.group.getMembers()) {
await this.publishEntityState(member.deviceIeeeAddress, payload, reason);
for (const member of entity.group.members) {
await this.publishEntityState(member.getDevice().ieeeAddr, payload, reason);
for (const zigbeeGroup of zigbeeGroups) {
if (zigbeeGroup.hasMember(member)) {
groupIDsToPublish.add(zigbeeGroup.groupID);
+6 -6
View File
@@ -1557,9 +1557,9 @@
}
},
"eslint": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-6.5.0.tgz",
"integrity": "sha512-IIbSW+vKOqMatPmS9ayyku4tvWxHY2iricSRtOz6+ZA5IPRlgXzEL0u/j6dr4eha0ugmhMwDTqxtmNu3kj9O4w==",
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-6.5.1.tgz",
"integrity": "sha512-32h99BoLYStT1iq1v2P9uwpyznQ4M2jRiFB6acitKz52Gqn+vPaMDUTB1bYi1WN4Nquj2w+t+bimYUG83DC55A==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
@@ -6053,9 +6053,9 @@
}
},
"zigbee-herdsman": {
"version": "0.7.6",
"resolved": "https://registry.npmjs.org/zigbee-herdsman/-/zigbee-herdsman-0.7.6.tgz",
"integrity": "sha512-Od4XNGLT6hxkFeibotU1WoopjAGvDc2LUpcly1rER0PA+clKU8WgkYvYkqBTqjfja1Q1s89k3QTgv+365nsxmg==",
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/zigbee-herdsman/-/zigbee-herdsman-0.8.0.tgz",
"integrity": "sha512-Nb8rElnm566CoFqhIYdvNrGaVEFqwEtXWgx9li492Ja1kyvNmbCsaqtIlWVOKpzTqlNbtOjxycDXyGwP60Gcpw==",
"requires": {
"debug": "^4.1.1",
"fast-deep-equal": "^2.0.1",
+1 -1
View File
@@ -44,7 +44,7 @@
"rimraf": "*",
"semver": "*",
"winston": "*",
"zigbee-herdsman": "0.7.6",
"zigbee-herdsman": "0.8.0",
"zigbee-herdsman-converters": "11.1.15"
},
"devDependencies": {
+4 -5
View File
@@ -8,7 +8,6 @@ class Group {
this.meta = {};
this.members = [];
this.hasMember = (endpoint) => this.members.includes(endpoint);
this.getMembers = () => this.members;
}
}
@@ -46,6 +45,10 @@ class Endpoint {
if (!group.members.includes(this)) group.members.push(this);
}
this.getDevice = () => {
return Object.values(devices).find(d => d.ieeeAddr === deviceIeeeAddress);
}
this.removeFromGroup = (group) => {
const index = group.members.indexOf(this);
if (index != -1) {
@@ -81,10 +84,6 @@ class Device {
getEndpoint(ID) {
return this.endpoints.find((e) => e.ID === ID);
}
getEndpoints() {
return this.endpoints;
}
}
const returnDevices = [];