Hello all.
I'm using a Gira HS3 for which I've made some logic modules.
They all work well but one of them is creating exceptions in the debug list.
It's a module I use to output temperatures sent by Mobotix cameras as a Float and as a string.
The temperature is a string with a fixed length of 5 characters starting with the + or - sign.
If the absolute value of the temperature is smaller than 10 the second character is a space.
For example:
+13.4
+ 4.7
-12.7
- 2.3
The formula looks like this:
Anybody who could tell me what's wrong with my formula?
Danke!
I'm using a Gira HS3 for which I've made some logic modules.
They all work well but one of them is creating exceptions in the debug list.
It's a module I use to output temperatures sent by Mobotix cameras as a Float and as a string.
The temperature is a string with a fixed length of 5 characters starting with the + or - sign.
If the absolute value of the temperature is smaller than 10 the second character is a space.
For example:
+13.4
+ 4.7
-12.7
- 2.3
28.03.2018 22:15:42 (1) File "./../hssrc/hs_logik.py", line 232, in calc File "formula", line 1, in [module] ValueError: invalid literal for float(): ---- [5012L, 10032L, 0L, "(EN[2][:1])=='-'", 'float(EN[2][-4:])', '', 0L, 0L, 1L, 0L] |
28.03.2018 22:15:42 (2) File "./../hssrc/hs_logik.py", line 232, in calc File "formula", line 1, in [module] ValueError: invalid literal for float(): ---- [5012L, 10032L, 0L, "(EN[3][:1])=='-'", 'float(EN[3][-4:])', '', 0L, 0L, 2L, 0L] |
5012|0|"(EN[2][:1])=='+'" |"float(EN[2][-4:])" |""|0|0|1|0 # temp postive and >= +10
5012|0|"(EN[2][:1])=='+ '"|"float(EN[2][-3:])" |""|0|0|1|0 # temp postive and < +10
5012|0|"(EN[2][:1])=='-'" |"0-float(EN[2][-4:])"|""|0|0|1|0 # temp negative and <= -10
5012|0|"(EN[2][:1])=='- '"|"0-float(EN[2][-3:])"|""|0|0|1|0 # temp negative and > -10
5012|0|"(EN[2][:1])=='+ '"|"float(EN[2][-3:])" |""|0|0|1|0 # temp postive and < +10
5012|0|"(EN[2][:1])=='-'" |"0-float(EN[2][-4:])"|""|0|0|1|0 # temp negative and <= -10
5012|0|"(EN[2][:1])=='- '"|"0-float(EN[2][-3:])"|""|0|0|1|0 # temp negative and > -10
Danke!
Kommentar