           @param {Function} reject - function to reject a promise on return,
                                      may be null
           @param {Error} error  - error object
-          @param {String} [customMessage]  - a custom message to be used as prefix
-                                             to the error message
+          @param {String} [customMessage]  - a custom message to be used
+                                             as prefix to the error message
         ###
         rejectWithErrorString: (reject, error="Unknown", customMessage=null) ->
           message = "" + (error.message ? error)

            timerData.target = timerData.delay
            timerData.startTime = Date.now() - timerData.delay
          else
            elapsed = Date.now() - timerData.startTime;
            adjust = timerData.target - elapsed;

          timerData.target += timerData.delay
          if common._periodicTimers.hasOwnProperty(id)
            common._periodicTimers[id] = setTimeout(taskHandler, timerData.delay + adjust)
            timerData.func()

        return id

          only updated if the value has been changed.
          @param {String} attributeName - the attribute name
          @param {Any} value - the attribute value
          @param [Boolean} [discrete=false] - True if attribute value is
          discrete, e.g., a switch state. False, otherwise.
        ###
        setAttribute: (attributeName, value, discrete=false) ->
          if value? and not discrete or device['_' + attributeName] isnt value
