Can anyone explain why the parameters do not get executed when using the perform_code() method? This is the only way I managed to get this to send successfully:
from dsf.connections import CommandConnection
from dsf.commands.code import Code
from dsf.commands.code import CodeFlags
from dsf.commands.code import CodeType
from dsf.commands.codeparameter import CodeParameter
def send_code():
command_connection = CommandConnection(debug=True)
command_connection.connect()
instance = Code("Code")
instance.Type = CodeType.MCode
instance.MajorNumber = 106
instance.parameter = CodeParameter('S', 255)
instance.Flags = CodeFlags.Asynchronous
It sends, responds with success, but nothing happens, fan speed does not change, but commands with no parameter work fine, such as G28, or T0 etc.
send: {"command":"Code","Type":"M","MajorNumber":106,"parameter":{"letter":"S","string_value":"255","_CodeParameter__parsed_value":255,"is_expression":false},"Flags":1}
recv: {"success":true}