Skip to content

Commit

Permalink
Merge pull request #2294 from asgothian/master
Browse files Browse the repository at this point in the history
Fix keyless converters
  • Loading branch information
asgothian authored Nov 17, 2024
2 parents d1f4cac + 5138ec8 commit 11f5a6f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -715,12 +715,20 @@ class Zigbee extends utils.Adapter {

if (!c.hasOwnProperty('convertSet')) continue;
this.log.debug(`Type of toZigbee is '${typeof c}', Contains key ${(c.hasOwnProperty('key')?JSON.stringify(c.key):'false ')}`)
if (!c.hasOwnProperty('key') && c.hasOwnProperty('convertSet') && converter === undefined)
if (!c.hasOwnProperty('key'))
{
converter = c;

if (has_elevated_debug) this.log.warn(`ELEVATED: setting converter to keyless converter for ${deviceId} of type ${model}`)
this.log.debug('setting converter to keyless converter')
if (c.hasOwnProperty('convertSet') && converter === undefined)
{
converter = c;

if (has_elevated_debug) this.log.warn(`ELEVATED: setting converter to keyless converter for ${deviceId} of type ${model}`)
this.log.debug('setting converter to keyless converter')
}
else
{
if (has_elevated_debug) this.log.warn(`ELEVATED: ignoring keyless converter for ${deviceId} of type ${model}`)
this.log.debug('ignoring keyless converter')
}
continue;
}
if (c.key.includes(stateDesc.prop) || c.key.includes(stateDesc.setattr) || c.key.includes(stateDesc.id))
Expand Down

0 comments on commit 11f5a6f

Please sign in to comment.