autotest: allow message rates to be set by message name, not just ID

Simply for convenience.
This commit is contained in:
Peter Barker 2020-06-24 13:16:09 +10:00 committed by Peter Barker
parent cd1198bf49
commit 3737c13784

View File

@ -5130,6 +5130,8 @@ class AutoTest(ABC):
def set_message_rate_hz(self, id, rate_hz):
'''set a message rate in Hz; 0 for original, -1 to disable'''
if type(id) == str:
id = eval("mavutil.mavlink.MAVLINK_MSG_ID_%s" % id)
if rate_hz == 0 or rate_hz == -1:
set_interval = rate_hz
else: