buttplugio / buttplug-rs-ffi

FFI from buttplug-rs to Java and other languages
Other
88 stars 22 forks source link

js: ButtplugClientDevice.vibrate does not take an array of numbers #59

Closed WesleyAC closed 3 years ago

WesleyAC commented 3 years ago

Calling device.vibrate([1.0, 1.0]) results in the error:

vibrate can only take numbers or arrays of numbers.

The actual behaviour is that vibrate can take a number or an array of VibrationCmds. So as not to make breaking changes, it's probably best to change vibrate to take either a number, array of numbers, or array of VibrationCmds. Alternatively, the error could be changed to be accurate to the behavior, but taking an array of numbers seems convenient enough to include, and is the documented behaviour elsewhere.

relevant code

qdot commented 3 years ago

Annnnnnnnd this is why I need to finish implementing test devices for the FFI so we can start getting unit tests in. :|

Thanks for the report! I'll see about getting this fixed up, just need to add an extra check.

qdot commented 3 years ago

Fixed and tested in 1.0.13