Create custom message with min and max value for a specific field
Hi,
maybe a very bad question but I haven't seen a solution anywhere. I want to create a range for an int8 from where to where the numbers I transfer are allowed to go.
I tried it with an enumeration:
# Percentage value for dimmers
# Possible states for Dimmer
int8 0=0
int8 1=1
int8 2=2
int8 3=3
int8 4=4
int8 5=5
int8 6=6
int8 7=7
int8 8=8
int8 9=9
int8 10=10
int8 state # Dimmer state enumerated above
Header header
string item # the name of the item
I am sure that this is not the right solution. I get the following error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/catkin_ws/devel/lib/python3/dist-packages/openhab_msgs/msg/__init__.py", line 8, in <module>
from ._DimmerState import *
File "/home/ubuntu/catkin_ws/devel/lib/python3/dist-packages/openhab_msgs/msg/_DimmerState.py", line 141
0 = 0
^
I know that enumerations don't make sense with numbers, of course. I want to use only the numbers from 0 to 100 at the end. In the example above there was only a section from 0 to 10.
Does anyone have an idea? Thanks in advance.