0

Want to import a string from xbmc setting and put it in the time.sleep function. Code:

debouncing_video  =  settings.getSetting( "Debounce_video")
debouncing_audio  =  settings.getSetting( "Debounce_audio")
time.sleep(denouncing_video)

If i replace the (debouncing_video) with a 3, it wait for tree second. If i print the string (denouncing_video) it say 3 but if i put time.sleep(debouncing_video) it is not working Thanks

1 Answers1

0

The value returned is a string. Convert it to an int:

debouncing_video  =  int(settings.getSetting( "Debounce_video"))

See the API:

getSetting(id) -- Returns the value of a setting as a unicode string.

You would have seen an error in the xbmc.log that says TypeError: a float is required.

Geoff
  • 7,935
  • 3
  • 35
  • 43