Пример #1
0
async def test_device_vibrate_dict():
    client = DummyClient()
    dev = ButtplugClientDevice(client, DeviceInfo("Test Vibration Device",
                                                  0,
                                                  {"VibrateCmd":
                                                   {"FeatureCount": 1}}))
    await dev.send_vibrate_cmd({0: 1.0})
    assert client.last_message == VibrateCmd(0, [SpeedSubcommand(0, 1.0)])
Пример #2
0
 def test_vibrate_cmd(self):
     vibrate_cmd = VibrateCmd(0, [SpeedSubcommand(0, 0),
                                  SpeedSubcommand(1, 0.5)])
     json_msg = "{\"VibrateCmd\": {\"DeviceIndex\": 0, \"Speeds\": [{\"Index\": 0, \"Speed\": 0}, {\"Index\": 1, \"Speed\": 0.5}], \"Id\": 1}}"
     self.run_msg_test(vibrate_cmd,  json_msg)