async waitForState(targetState,timeout) {
        let startTime=Date.now();
        do {
            let currentState=await this.isEnabled();
            if (currentState===targetState) {
                return true;
            }
            await sleep(100);
        } while (Math.abs(startTime-Date.now())<(timeout*1000));
        return false;
    }
Wait for this.isEnabled()==targetState up to timeout seconds, returns true if target state was reached

@param {boolean} targetState
@param {number} timeout in seconds
@returns {Promise<boolean>}