additional check in add command
This commit is contained in:
@ -311,8 +311,9 @@ class CmdInterpreter(cmd.Cmd):
|
|||||||
raise CmdInterpreterException('writeTopic must not be set when scanRate is zero')
|
raise CmdInterpreterException('writeTopic must not be set when scanRate is zero')
|
||||||
if feedbackTopic:
|
if feedbackTopic:
|
||||||
raise CmdInterpreterException('feedbackTopic must not be set when scanRate is zero')
|
raise CmdInterpreterException('feedbackTopic must not be set when scanRate is zero')
|
||||||
if registerType not in ['HoldingRegister']:
|
allowedRegisterTypes = ['HoldingRegister']
|
||||||
raise CmdInterpreterException('Unknown register type {0}'.format(registerType))
|
if registerType not in allowedRegisterTypes:
|
||||||
|
raise CmdInterpreterException('Unknown register type {0}, allowed are {1!s}'.format(registerType, allowedRegisterTypes))
|
||||||
|
|
||||||
|
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
|
Reference in New Issue
Block a user