additional check in add command

This commit is contained in:
2019-06-27 12:17:17 +02:00
parent 8d6d8e5901
commit 851cfd76d8

View File

@ -311,8 +311,9 @@ class CmdInterpreter(cmd.Cmd):
raise CmdInterpreterException('writeTopic must not be set when scanRate is zero')
if feedbackTopic:
raise CmdInterpreterException('feedbackTopic must not be set when scanRate is zero')
if registerType not in ['HoldingRegister']:
raise CmdInterpreterException('Unknown register type {0}'.format(registerType))
allowedRegisterTypes = ['HoldingRegister']
if registerType not in allowedRegisterTypes:
raise CmdInterpreterException('Unknown register type {0}, allowed are {1!s}'.format(registerType, allowedRegisterTypes))
except ValueError as e: