async setState(state) {
        if (state === this.state) { // No point in setting the same state again
            return;
        }

        if (this.isConnected) {
            await this.publish(this.currentConfig.stateTopic, state, {
                // @ts-ignore
                qos: MqttCommonAttributes.QOS.AT_MOST_ONCE, // Anything other than QoS 0 can potentially block for a long time
                retain: true
            });
        }

        Logger.trace("MQTT State change", {
            prev: this.state,
            new: state
        });

        this.state = state;
    }
Set device state

@private
@param {string} state
@return {Promise<void>}