How to use the @iobroker/adapter-react/Components/Utils.disableSmartName function in @iobroker/adapter-react

To help you get started, we’ve selected a few @iobroker/adapter-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ioBroker / ioBroker.iot / src / src / Tabs / Enums.js View on Github external
onToggleEnum(id) {
        let obj = this.state.funcs.find(e => e._id === id) || this.state.rooms.find(e => e._id === id);

        let smartName = Utils.getSmartNameFromObj(obj);
        obj = JSON.parse(JSON.stringify(obj));
        if (smartName !== false) {
            Utils.disableSmartName(obj, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
        } else {
            Utils.removeSmartName(obj, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
        }

        this.addChanged(id);

        this.props.socket.setObject(id, obj)
            .then(() => {
                // update obj
                this.updateObjInState(id, obj);
                this.informInstance(id);

                setTimeout(() => this.removeChanged(id), 500);
            });
    }
github ioBroker / ioBroker.iot / src / src / Tabs / AlisaSmartNames.js View on Github external
.then(obj => {
                    Utils.disableSmartName(obj, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
                    return this.props.socket.setObject(id, obj);
                })
                .then(() => {
github ioBroker / ioBroker.iot / src / src / Tabs / AlexaSmartNames.js View on Github external
.then(obj => {
                    Utils.disableSmartName(obj, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
                    return this.props.socket.setObject(id, obj);
                })
                .then(() => {
github ioBroker / ioBroker.iot / src / src / Tabs / GoogleSmartNames.js View on Github external
.then(obj => {
                    Utils.disableSmartName(obj, this.props.adapterName + '.' + this.props.instance, this.props.native.noCommon);
                    return this.props.socket.setObject(id, obj);
                })
                .then(() => {