diff --git a/src/converters/fromZigbee.js b/src/converters/fromZigbee.js index 67e6e9d20848b..0947770ce7c19 100644 --- a/src/converters/fromZigbee.js +++ b/src/converters/fromZigbee.js @@ -3269,7 +3269,7 @@ const converters = { 8: 'finger_delete', 9: 'password_add', 10: 'password_delete', - 11: 'lock_opened_inside', // Open form inside reverse lock enbable + 11: 'lock_opened_inside', // Open form inside reverse lock enable 12: 'lock_opened_outside', // Open form outside reverse lock disable 13: 'ring_bell', 14: 'change_language_to', @@ -3336,7 +3336,7 @@ const converters = { 8: 'finger_delete', 9: 'password_add', 10: 'password_delete', - 11: 'lock_opened_inside', // Open form inside reverse lock enbable + 11: 'lock_opened_inside', // Open form inside reverse lock enable 12: 'lock_opened_outside', // Open form outside reverse lock disable 13: 'ring_bell', 14: 'change_language_to', @@ -3440,7 +3440,7 @@ const converters = { const userId = data.substr(12, 2); result.action = lockStatusLookup[6+parseInt(command, 16)]; result.action_user = parseInt(userId, 16); - } else if (msg.data['65522']) { // set languge + } else if (msg.data['65522']) { // set language const data = Buffer.from(msg.data['65522'], 'ascii').toString('hex'); const langId = data.substr(6, 2); // 1 chinese, 2: english result.action = (lockStatusLookup[14])+ (langId==='2'?'_english':'_chinese'); @@ -3575,7 +3575,7 @@ const converters = { convert: (model, msg, publish, options, meta) => { const commandID = msg.data.commandID; if (hasAlreadyProcessedMessage(msg, model, msg.data.frameCounter, `${msg.device.ieeeAddr}_${commandID}`)) return; - if (commandID === 224) return; // Skip commisioning command. + if (commandID === 224) return; // Skip commissioning command. // Button 1: A0 (top left) // Button 2: A1 (bottom left) @@ -4180,7 +4180,7 @@ const converters = { globalStore.putValue(msg.endpoint, 'hold', false); }, options.hold_timeout_expire || 4000); globalStore.putValue(msg.endpoint, 'hold_timer', holdTimer); - // After 4000 milliseconds of not reciving release we assume it will not happen. + // After 4000 milliseconds of not receiving release we assume it will not happen. }, options.hold_timeout || 1000); // After 1000 milliseconds of not releasing we assume hold. globalStore.putValue(msg.endpoint, 'timer', timer); } else if (state === 1) { @@ -4852,11 +4852,11 @@ const converters = { entry.CurrentPosition = currentPosition; if (msg.data.hasOwnProperty('currentPositionLiftPercentage') && msg.data['currentPositionLiftPercentage'] !== 50 ) { - // postion cast float to int + // position cast float to int result.position = currentPosition | 0; } else { if (deltaTimeSec < timeCoverSetMiddle || deltaTimeSec > timeCoverSetMiddle) { - // postion cast float to int + // position cast float to int result.position = currentPosition | 0; } else { entry.CurrentPosition = lastPreviousAction; @@ -5229,7 +5229,7 @@ const converters = { result.angle_y = Math.round(Math.atan(y/Math.sqrt(x*x+z*z)) * 180 / Math.PI); result.angle_z = Math.round(Math.atan(z/Math.sqrt(x*x+y*y)) * 180 / Math.PI); - // calculate absolulte angle + // calculate absolute angle const R = Math.sqrt(x * x + y * y + z * z); result.angle_x_absolute = Math.round((Math.acos(x / R)) * 180 / Math.PI); result.angle_y_absolute = Math.round((Math.acos(y / R)) * 180 / Math.PI); diff --git a/src/converters/toZigbee.js b/src/converters/toZigbee.js index a0a7310e83851..c6915bceeae98 100644 --- a/src/converters/toZigbee.js +++ b/src/converters/toZigbee.js @@ -728,8 +728,8 @@ const converters = { await entity.command('lightingColorCtrl', 'stepColorTemp', payload, utils.getOptions(meta.mapped, entity)); // We cannot determine the color temperature from the current state so we read it, because - // - We don't know the max/min valus - // - Color mode could have been swithed (x/y or hue/saturation) + // - We don't know the max/min values + // - Color mode could have been switched (x/y or hue/saturation) const entityToRead = utils.getEntityOrFirstGroupMember(entity); if (entityToRead) { await utils.sleep(100 + (transition * 100)); @@ -754,7 +754,7 @@ const converters = { await entity.command('lightingColorCtrl', 'moveColorTemp', payload, utils.getOptions(meta.mapped, entity)); // We cannot determine the color temperaturefrom the current state so we read it, because - // - Color mode could have been swithed (x/y or colortemp) + // - Color mode could have been switched (x/y or colortemp) if (value === 'stop' || value === 0) { const entityToRead = utils.getEntityOrFirstGroupMember(entity); if (entityToRead) { @@ -821,7 +821,7 @@ const converters = { await entity.command('lightingColorCtrl', command, payload, utils.getOptions(meta.mapped, entity)); // We cannot determine the hue/saturation from the current state so we read it, because - // - Color mode could have been swithed (x/y or colortemp) + // - Color mode could have been switched (x/y or colortemp) const entityToRead = utils.getEntityOrFirstGroupMember(entity); if (entityToRead) { await utils.sleep(100 + (transition * 100)); @@ -852,7 +852,7 @@ const converters = { await entity.command('lightingColorCtrl', command, payload, utils.getOptions(meta.mapped, entity)); // We cannot determine the hue/saturation from the current state so we read it, because - // - Color mode could have been swithed (x/y or colortemp) + // - Color mode could have been switched (x/y or colortemp) if (value === 'stop' || value === 0) { const entityToRead = utils.getEntityOrFirstGroupMember(entity); if (entityToRead) { @@ -1089,7 +1089,7 @@ const converters = { // Some bulbs e.g. RB 185 C don't turn to red (they don't respond at all) when x: 0.701 and y: 0.299 // is send. These values are e.g. send by Home Assistant when clicking red in the color wheel. - // If we slighlty modify these values the bulb will respond. + // If we slightly modify these values the bulb will respond. // https://github.com/home-assistant/home-assistant/issues/31094 if (utils.getMetaValue(entity, meta.mapped, 'applyRedFix', 'allEqual', false) && xy.x == 0.701 && xy.y === 0.299) { xy.x = 0.7006; @@ -2677,7 +2677,7 @@ const converters = { }, }, ledvance_commands: { - /* deprectated osram_*/ + /* deprecated osram_*/ key: ['set_transition', 'remember_state', 'osram_set_transition', 'osram_remember_state'], convertSet: async (entity, key, value, meta) => { if (key === 'osram_set_transition' || key === 'set_transition') { @@ -3932,7 +3932,7 @@ const converters = { convertSet: async (entity, key, value, meta) => { // enable the LED when the light object is "doing something" // on the light switch, the LED is on when the light is on, - // on the shutter switch, the LED is on when te shutter is moving + // on the shutter switch, the LED is on when the shutter is moving const enableLedIfOn = value === 'ON' || (value === 'OFF' ? false : !!value); const payload = {2: {value: enableLedIfOn, type: 16}}; await entity.write('manuSpecificLegrandDevices', payload, manufacturerOptions.legrand); @@ -4270,7 +4270,7 @@ const converters = { } else if (response.status === 0) { utils.saveSceneState(entity, sceneid, groupid, meta.state, scenename); } else { - throw new Error(`Scene add not succesfull ('${herdsman.Zcl.Status[response.status]}')`); + throw new Error(`Scene add not successful ('${herdsman.Zcl.Status[response.status]}')`); } meta.logger.info('Successfully stored scene'); return {state: {}}; @@ -4452,7 +4452,7 @@ const converters = { * payloads to be merged. Resulting in unexpected behavior when * trying to replace a scene. * - * We accept a SUCESS or NOT_FOUND as a result of the remove call. + * We accept a SUCCESS or NOT_FOUND as a result of the remove call. */ const removeresp = await entity.command( 'genScenes', 'remove', {groupid, sceneid}, utils.getOptions(meta.mapped, entity), @@ -4473,7 +4473,7 @@ const converters = { } else if (response.status === 0) { utils.saveSceneState(entity, sceneid, groupid, state, scenename); } else { - throw new Error(`Scene add not succesfull ('${herdsman.Zcl.Status[response.status]}')`); + throw new Error(`Scene add not successful ('${herdsman.Zcl.Status[response.status]}')`); } } else { throw new Error(`Scene add unable to remove existing scene ('${herdsman.Zcl.Status[removeresp.status]}')`); @@ -4500,7 +4500,7 @@ const converters = { } else if (response.status === 0) { utils.deleteSceneState(entity, sceneid, groupid); } else { - throw new Error(`Scene remove not succesfull ('${herdsman.Zcl.Status[response.status]}')`); + throw new Error(`Scene remove not successful ('${herdsman.Zcl.Status[response.status]}')`); } meta.logger.info('Successfully removed scene'); }, @@ -4522,7 +4522,7 @@ const converters = { } else if (response.status === 0) { utils.deleteSceneState(entity); } else { - throw new Error(`Scene remove all not succesfull ('${herdsman.Zcl.Status[response.status]}')`); + throw new Error(`Scene remove all not successful ('${herdsman.Zcl.Status[response.status]}')`); } meta.logger.info('Successfully removed all scenes'); },