added protocol to change Device Setting (Type/Postion)
This commit is contained in:
20
tools/set_device_type.py
Normal file
20
tools/set_device_type.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from cls_device_pb2 import UpdateDeviceSettings, Type, Position
|
||||
from usb_pb2 import PackageType
|
||||
from vcp_driver import *
|
||||
|
||||
if __name__ == "__main__":
|
||||
ser = setup_connection()
|
||||
# Create a message
|
||||
request = UpdateDeviceSettings()
|
||||
request.device = 1
|
||||
request.type = Type.LIGHT
|
||||
request.position.append(Position.RIGHT)
|
||||
request.position.append(Position.FLOOR)
|
||||
# Serialize the request to a bytearray
|
||||
request_data = request.SerializeToString()
|
||||
|
||||
|
||||
print(request)
|
||||
print(request_data)
|
||||
# Send the request
|
||||
send_package(PackageType.UPDATE_DEVICE_SETTINGS, request_data, ser)
|
||||
Reference in New Issue
Block a user