Skip to content

Commit

Permalink
Merge pull request #1983 from crckmc/master
Browse files Browse the repository at this point in the history
Bump zigbee-herdsman to 0.26.1
  • Loading branch information
arteck authored Dec 15, 2023
2 parents 15d491f + 2fd028e commit 78fe831
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 30 deletions.
2 changes: 1 addition & 1 deletion lib/exposes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const statesDefs = require('./states.js').states;
const rgb = require('./rgb.js');
const utils = require('./utils.js');
const colors = require('./colors.js');
const ea = zigbeeHerdsmanConverters.exposes.access;
const ea = require('zigbee-herdsman-converters/lib/exposes.js').access;

function genState(expose, role, name, desc) {
let state;
Expand Down
2 changes: 1 addition & 1 deletion lib/statescontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class StatesController extends EventEmitter {
const result = {};
// find model states for options and get it values
const devStates = await this.getDevStates('0x' + devId, model);
if (devStates == null || devStates == undefined) {
if (devStates == null || devStates == undefined || devStates.states == null || devStates.states == undefined) {
callback(result);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function flatten(arr) {

const forceEndDevice = flatten(
['QBKG03LM', 'QBKG04LM', 'ZNMS13LM', 'ZNMS12LM']
.map(model => zigbeeHerdsmanConverters.devices.find((d) => d.model === model))
.map(model => zigbeeHerdsmanConverters.findByModel(model))
.map(mappedModel => mappedModel.zigbeeModel));

// Xiaomi uses 4151 and 4447 (lumi.plug) as manufacturer ID.
Expand Down
10 changes: 5 additions & 5 deletions lib/zbDeviceAvailability.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const utils = require('./utils');
// Some EndDevices should be pinged
// e.g. E11-G13 https://github.com/Koenkk/zigbee2mqtt/issues/775#issuecomment-453683846
const forcedPingable = [
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'E11-G13'),
zigbeeHerdsmanConverters.devices.find((d) => d.model === '53170161'),
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'V3-BTZB'),
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'SPZB0001'),
zigbeeHerdsmanConverters.devices.find((d) => d.model === '014G2461')
zigbeeHerdsmanConverters.findByModel('E11-G13'),
zigbeeHerdsmanConverters.findByModel('53170161'),
zigbeeHerdsmanConverters.findByModel('V3-BTZB'),
zigbeeHerdsmanConverters.findByModel('SPZB0001'),
zigbeeHerdsmanConverters.findByModel('014G2461')
];

// asgothian: 29.12.2020: Removed color and color_temp from readable
Expand Down
8 changes: 4 additions & 4 deletions lib/zbDeviceConfigure.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
const BaseExtension = require('./zbBaseExtension');

const forcedConfigureOnEachStart = [
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'V3-BTZB'),
zigbeeHerdsmanConverters.devices.find((d) => d.model === '014G2461'),
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'SPZB0001'),
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'ZK03840')
zigbeeHerdsmanConverters.findByModel('V3-BTZB'),
zigbeeHerdsmanConverters.findByModel('014G2461'),
zigbeeHerdsmanConverters.findByModel('SPZB0001'),
zigbeeHerdsmanConverters.findByModel('ZK03840')
];

class DeviceConfigure extends BaseExtension {
Expand Down
25 changes: 12 additions & 13 deletions lib/zigbeecontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@ const DeviceConfigureExt = require('./zbDeviceConfigure');
const DeviceEventExt = require('./zbDeviceEvent');
const DelayedActionExt = require('./zbDelayedAction');
const utils = require('./utils');

const groupConverters = [
zigbeeHerdsmanConverters.toZigbeeConverters.light_onoff_brightness,
zigbeeHerdsmanConverters.toZigbeeConverters.light_color_colortemp,
zigbeeHerdsmanConverters.toZigbee.light_onoff_brightness,
zigbeeHerdsmanConverters.toZigbee.light_color_colortemp,
zigbeeHerdsmanConvertersPhilips.tz.effect, // Support Hue effects for groups
zigbeeHerdsmanConverters.toZigbeeConverters.ignore_transition,
zigbeeHerdsmanConverters.toZigbeeConverters.cover_position_tilt,
zigbeeHerdsmanConverters.toZigbeeConverters.thermostat_occupied_heating_setpoint,
zigbeeHerdsmanConverters.toZigbeeConverters.tint_scene,
zigbeeHerdsmanConverters.toZigbeeConverters.light_brightness_move,
zigbeeHerdsmanConverters.toZigbeeConverters.light_brightness_step,
zigbeeHerdsmanConverters.toZigbeeConverters.light_colortemp_step,
zigbeeHerdsmanConverters.toZigbeeConverters.light_colortemp_move,
zigbeeHerdsmanConverters.toZigbeeConverters.light_hue_saturation_move,
zigbeeHerdsmanConverters.toZigbeeConverters.light_hue_saturation_step
zigbeeHerdsmanConverters.toZigbee.ignore_transition,
zigbeeHerdsmanConverters.toZigbee.cover_position_tilt,
zigbeeHerdsmanConverters.toZigbee.thermostat_occupied_heating_setpoint,
zigbeeHerdsmanConverters.toZigbee.tint_scene,
zigbeeHerdsmanConverters.toZigbee.light_brightness_move,
zigbeeHerdsmanConverters.toZigbee.light_brightness_step,
zigbeeHerdsmanConverters.toZigbee.light_colortemp_step,
zigbeeHerdsmanConverters.toZigbee.light_colortemp_move,
zigbeeHerdsmanConverters.toZigbee.light_hue_saturation_move,
zigbeeHerdsmanConverters.toZigbee.light_hue_saturation_step


/* zigbeeHerdsmanConverters.toZigbeeConverters.light_onoff_brightness,
Expand Down
5 changes: 2 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ class Zigbee extends utils.Adapter {
async publishFromState(deviceId, model, stateModel, stateList, options) {
let isGroup = false;

this.log.debug(`publishFromState : ${deviceId} ${model}`);
this.log.debug(`publishFromState : ${deviceId} ${model} ${safeJsonStringify(stateList)}`);
if (model === 'group') {
isGroup = true;
deviceId = parseInt(deviceId);
Expand Down Expand Up @@ -704,7 +704,7 @@ class Zigbee extends utils.Adapter {
}

const epName = stateDesc.epname !== undefined ? stateDesc.epname : (stateDesc.prop || stateDesc.id);
const key = stateDesc.setattr || stateDesc.prop || stateDesc.id;
const key = stateDesc.prop || stateDesc.id || stateDesc.setattr;
this.log.debug(`convert ${key}, ${safeJsonStringify(preparedValue)}, ${safeJsonStringify(preparedOptions)}`);

let target;
Expand Down Expand Up @@ -965,7 +965,6 @@ class Zigbee extends utils.Adapter {
disableBackup: this.config.disableBackup,
extPanIdFix: extPanIdFix,
startWithInconsistent: this.config.startWithInconsistent || false,
legacy: false,
};
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"@iobroker/adapter-core": "^3.0.4",
"tar": "^6.2.0",
"typescript": "^5.2.2",
"zigbee-herdsman": "0.23.0",
"zigbee-herdsman-converters": "15.132.0"
"zigbee-herdsman": "0.26.1",
"zigbee-herdsman-converters": "16.6.0"
},
"description": "Zigbee devices",
"devDependencies": {
Expand Down

0 comments on commit 78fe831

Please sign in to comment.