From ce359f26fa0f9f59bc8937e84f9d0ea144443dfd Mon Sep 17 00:00:00 2001 From: Christian Scholz Date: Tue, 30 Jan 2024 19:38:30 +0100 Subject: [PATCH] final linting - god send me the power to strike down the guy who invented that vscode plugin... --- lib/devices/gen3-helper.js | 86 +++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/lib/devices/gen3-helper.js b/lib/devices/gen3-helper.js index e4ad478d..45d7836c 100644 --- a/lib/devices/gen3-helper.js +++ b/lib/devices/gen3-helper.js @@ -645,13 +645,13 @@ function addSwitchToGen3Device(deviceObj, switchId, hasPowerMetering) { mqtt_cmd: '/rpc', mqtt_cmd_funct: (value, self) => { return JSON.stringify({ - id: self.getNextMsgId(), - src: 'iobroker', - method: 'Switch.SetConfig', - params: { - id: switchId, - config: { power_limit: value }, - }, + id: self.getNextMsgId(), + src: 'iobroker', + method: 'Switch.SetConfig', + params: { + id: switchId, + config: { power_limit: value }, + }, }); }, }, @@ -674,13 +674,13 @@ function addSwitchToGen3Device(deviceObj, switchId, hasPowerMetering) { mqtt_cmd: '/rpc', mqtt_cmd_funct: (value, self) => { return JSON.stringify({ - id: self.getNextMsgId(), - src: 'iobroker', - method: 'Switch.SetConfig', - params: { - id: switchId, - config: { current_limit: value }, - }, + id: self.getNextMsgId(), + src: 'iobroker', + method: 'Switch.SetConfig', + params: { + id: switchId, + config: { current_limit: value }, + }, }); }, }, @@ -703,13 +703,13 @@ function addSwitchToGen3Device(deviceObj, switchId, hasPowerMetering) { mqtt_cmd: '/rpc', mqtt_cmd_funct: (value, self) => { return JSON.stringify({ - id: self.getNextMsgId(), - src: 'iobroker', - method: 'Switch.SetConfig', - params: { - id: switchId, - config: { voltage_limit: value }, - }, + id: self.getNextMsgId(), + src: 'iobroker', + method: 'Switch.SetConfig', + params: { + id: switchId, + config: { voltage_limit: value }, + }, }); }, }, @@ -798,14 +798,14 @@ function addInputToGen3Device(deviceObj, inputId) { valueObj?.params?.events ) { for (const e in valueObj.params.events) { - const event = valueObj.params.events[e]; + const event = valueObj.params.events[e]; - if ( - typeof event === 'object' && + if ( + typeof event === 'object' && event.component === `input:${inputId}` - ) { - return event.event; - } + ) { + return event.event; + } } } return undefined; @@ -999,17 +999,17 @@ function addCoverToGen3Device(deviceObj, coverId) { if (duration > 0) { return JSON.stringify({ - id: self.getNextMsgId(), - src: 'iobroker', - method: 'Cover.Open', - params: { id: coverId, duration: duration }, + id: self.getNextMsgId(), + src: 'iobroker', + method: 'Cover.Open', + params: { id: coverId, duration: duration }, }); } else { return JSON.stringify({ - id: self.getNextMsgId(), - src: 'iobroker', - method: 'Cover.Open', - params: { id: coverId }, + id: self.getNextMsgId(), + src: 'iobroker', + method: 'Cover.Open', + params: { id: coverId }, }); } }, @@ -1058,17 +1058,17 @@ function addCoverToGen3Device(deviceObj, coverId) { if (duration > 0) { return JSON.stringify({ - id: self.getNextMsgId(), - src: 'iobroker', - method: 'Cover.Close', - params: { id: coverId, duration: duration }, + id: self.getNextMsgId(), + src: 'iobroker', + method: 'Cover.Close', + params: { id: coverId, duration: duration }, }); } else { return JSON.stringify({ - id: self.getNextMsgId(), - src: 'iobroker', - method: 'Cover.Close', - params: { id: coverId }, + id: self.getNextMsgId(), + src: 'iobroker', + method: 'Cover.Close', + params: { id: coverId }, }); } },