Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(obj => {
Utils.updateSmartName(obj, undefined, byON, type, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
if (this.state.lastChanged !== id) {
this.setState({lastChanged: id});
this.timerChanged && clearTimeout(this.timerChanged);
this.timerChanged = setTimeout(() => {
this.setState({lastChanged: ''});
this.timerChanged = null;
}, 30000);
}
return this.props.socket.setObject(id, obj);
})
.then(() => {
.then(obj => {
if (obj) {
const name = Utils.getObjectNameFromObj(obj, null, {language: I18n.getLanguage()});
Utils.updateSmartName(obj, (name || I18n.t('Device name')).replace(/[-_.]+/g, ' '), undefined, undefined, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
this.addChanged(obj._id);
this.waitForUpdateID = obj._id;
if (this.state.lastChanged !== obj._id) {
this.setState({lastChanged: obj._id});
this.timerChanged && clearTimeout(this.timerChanged);
this.timerChanged = setTimeout(() => {
this.setState({lastChanged: ''});
this.timerChanged = null;
}, 30000);
}
this.props.socket.setObject(obj._id, obj)
.then(() => this.informInstance(obj._id))
.catch(err => this.setState({message: err}));
} else {
.then(obj => {
Utils.updateSmartName(obj, undefined, byON, type, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
if (this.state.lastChanged !== id) {
this.setState({lastChanged: id});
this.timerChanged && clearTimeout(this.timerChanged);
this.timerChanged = setTimeout(() => {
this.setState({lastChanged: ''});
this.timerChanged = null;
}, 30000);
}
return this.props.socket.setObject(id, obj);
})
.then(() => {
.then(obj => {
if (obj) {
const name = Utils.getObjectNameFromObj(obj, null, {language: I18n.getLanguage()});
Utils.updateSmartName(obj, (name || I18n.t('Device name')).replace(/[-_.]+/g, ' '), undefined, undefined, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
this.addChanged(obj._id);
this.waitForUpdateID = obj._id;
if (this.state.lastChanged !== obj._id) {
this.setState({lastChanged: obj._id});
this.timerChanged && clearTimeout(this.timerChanged);
this.timerChanged = setTimeout(() => {
this.setState({lastChanged: ''});
this.timerChanged = null;
}, 30000);
}
obj.common.smartName.ghType="action.devices.types.LIGHT"
this.props.socket.setObject(obj._id, obj)
.then(() => {
this.informInstance(obj._id);
this.setState({message: I18n.t('Please add action and trait to complete the Google Home state.')});})
.then(obj => {
Utils.updateSmartName(obj, this.editedSmartName, undefined, undefined, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
return this.props.socket.setObject(id, obj);
})
.then(() => {
.then(obj => {
Utils.updateSmartName(obj, this.state.editedSmartName, undefined, undefined, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
newObj = obj;
return this.props.socket.setObject(id, obj);
})
.then(() => {
.then(obj => {
Utils.updateSmartName(obj, this.editedSmartName, undefined, editedSmartType === null ? undefined : editedSmartType, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
return this.props.socket.setObject(id, obj);
})
.then(() => {
.then(obj => {
if (obj) {
const name = Utils.getObjectNameFromObj(obj, null, {language: I18n.getLanguage()});
Utils.updateSmartName(obj, (name || I18n.t('Device name')).replace(/[-_.]+/g, ' '), undefined, undefined, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
this.addChanged(obj._id);
this.waitForUpdateID = obj._id;
if (this.state.lastChanged !== obj._id) {
this.setState({lastChanged: obj._id});
this.timerChanged && clearTimeout(this.timerChanged);
this.timerChanged = setTimeout(() => {
this.setState({lastChanged: ''});
this.timerChanged = null;
}, 30000);
}
this.props.socket.setObject(obj._id, obj)
.then(() => this.informInstance(obj._id))
.catch(err => this.setState({message: err}));
} else {