mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-03 02:21:38 +00:00
Update zigbee-herdsman and zigbee-herdsman-converters.
This commit is contained in:
@@ -87,7 +87,7 @@ class BridgeConfig extends BaseExtension {
|
||||
|
||||
async reset(topic, message) {
|
||||
try {
|
||||
await this.zigbee.softReset();
|
||||
await this.zigbee.reset('soft');
|
||||
logger.info('Soft resetted ZNP');
|
||||
} catch (error) {
|
||||
logger.error('Soft reset failed');
|
||||
|
||||
@@ -912,6 +912,9 @@ const mapping = {
|
||||
'3300-P': [cfg.sensor_temperature, cfg.binary_sensor_contact, cfg.sensor_battery],
|
||||
'GL-B-008ZS': [cfg.light_brightness_colortemp_colorxy],
|
||||
'T1829': [cfg.light_brightness_colortemp],
|
||||
'929002240401': [cfg.switch],
|
||||
'HGZB-20-UK': [cfg.switch],
|
||||
'MCT-340 SMA': [cfg.binary_sensor_contact, cfg.binary_sensor_battery_low],
|
||||
};
|
||||
|
||||
Object.keys(mapping).forEach((key) => {
|
||||
|
||||
@@ -40,7 +40,7 @@ class SoftReset extends BaseExtension {
|
||||
logger.warn('Soft reset timeout triggered');
|
||||
|
||||
try {
|
||||
await this.zigbee.softReset();
|
||||
await this.zigbee.reset('soft');
|
||||
logger.warn('Soft resetted ZNP due to timeout');
|
||||
} catch (error) {
|
||||
logger.warn('Soft reset failed, trying stop/start');
|
||||
|
||||
@@ -126,7 +126,7 @@ const schema = {
|
||||
serial: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
port: {type: 'string'},
|
||||
port: {type: ['string', 'null']},
|
||||
disable_led: {type: 'boolean'},
|
||||
},
|
||||
required: ['port'],
|
||||
|
||||
+2
-2
@@ -81,8 +81,8 @@ class Zigbee extends events.EventEmitter {
|
||||
return this.herdsman.getCoordinatorVersion();
|
||||
}
|
||||
|
||||
async softReset() {
|
||||
await this.herdsman.softReset();
|
||||
async reset(type) {
|
||||
await this.herdsman.reset(type);
|
||||
}
|
||||
|
||||
async stop() {
|
||||
|
||||
Generated
+6
-6
@@ -6053,9 +6053,9 @@
|
||||
}
|
||||
},
|
||||
"zigbee-herdsman": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/zigbee-herdsman/-/zigbee-herdsman-0.8.2.tgz",
|
||||
"integrity": "sha512-6Txmlms/4ugYHLKPsVzYPaAtjGk5MkmKfhZ0XwVGLU5W48XiEiEIg25vckdkFMe+6GxfisvUkndm756dqgoytA==",
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/zigbee-herdsman/-/zigbee-herdsman-0.9.0.tgz",
|
||||
"integrity": "sha512-xHAaMHCR/QzN7aoHOUoO6uUnB3s37ChFnQBdqqXf6g4Rjkdwr6czBfz9tWCNFwVQqD6rT7cgOjfIUR8OkHnppA==",
|
||||
"requires": {
|
||||
"debug": "^4.1.1",
|
||||
"fast-deep-equal": "^2.0.1",
|
||||
@@ -12559,9 +12559,9 @@
|
||||
}
|
||||
},
|
||||
"zigbee-herdsman-converters": {
|
||||
"version": "11.1.20",
|
||||
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-11.1.20.tgz",
|
||||
"integrity": "sha512-Nk9+687IHm1hUM/MpDxU59034IW44DSracQIT0pxjJH5yiIm3nVueWEvycglB7fuQ6q6335yD0FERxkNwtw4UA==",
|
||||
"version": "11.1.21",
|
||||
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-11.1.21.tgz",
|
||||
"integrity": "sha512-pMIn6Uuu2r+bvhND26yWutsZfI08MdDbujipabo+9N2ZrLOmiTbvW3r3zUzIQ/UakEDTHIkr0i7SkGPIHykBdQ==",
|
||||
"requires": {
|
||||
"debounce": "^1.2.0"
|
||||
}
|
||||
|
||||
+2
-2
@@ -45,8 +45,8 @@
|
||||
"rimraf": "*",
|
||||
"semver": "*",
|
||||
"winston": "*",
|
||||
"zigbee-herdsman": "0.8.2",
|
||||
"zigbee-herdsman-converters": "11.1.20"
|
||||
"zigbee-herdsman": "0.9.0",
|
||||
"zigbee-herdsman-converters": "11.1.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "*",
|
||||
|
||||
@@ -114,14 +114,16 @@ describe('Bridge config', () => {
|
||||
});
|
||||
|
||||
it('Should allow to reset', async () => {
|
||||
zigbeeHerdsman.softReset.mockClear();
|
||||
zigbeeHerdsman.reset.mockClear();
|
||||
MQTT.events.message('zigbee2mqtt/bridge/config/reset', '');
|
||||
await flushPromises();
|
||||
expect(zigbeeHerdsman.softReset).toHaveBeenCalledTimes(1);
|
||||
zigbeeHerdsman.softReset.mockImplementationOnce(() => {throw new Error('')});
|
||||
expect(zigbeeHerdsman.reset).toHaveBeenCalledTimes(1);
|
||||
expect(zigbeeHerdsman.reset).toHaveBeenCalledWith('soft');
|
||||
zigbeeHerdsman.reset.mockImplementationOnce(() => {throw new Error('')});
|
||||
MQTT.events.message('zigbee2mqtt/bridge/config/reset', '');
|
||||
await flushPromises();
|
||||
expect(zigbeeHerdsman.softReset).toHaveBeenCalledTimes(2);
|
||||
expect(zigbeeHerdsman.reset).toHaveBeenCalledTimes(2);
|
||||
expect(zigbeeHerdsman.reset.mock.calls[1][0]).toBe('soft');
|
||||
});
|
||||
|
||||
it('Should allow to set last_seen', async () => {
|
||||
|
||||
@@ -151,7 +151,7 @@ const mock = {
|
||||
return Object.values(groups).find((d) => d.groupID === groupID);
|
||||
}),
|
||||
getPermitJoin: jest.fn().mockReturnValue(false),
|
||||
softReset: jest.fn(),
|
||||
reset: jest.fn(),
|
||||
createGroup: jest.fn().mockImplementation((groupID) => {
|
||||
const group = new Group(groupID);
|
||||
groups[`group_${groupID}`] = group
|
||||
|
||||
Reference in New Issue
Block a user