I know the question is silly… but why!?! my string (keypad.state as DecimalType != 1111
!= is flagged as an error
No closing )
DSL?
javascript?
Rest of the script?
!= is flagged as an error and ==
if (keypad.state as DecimalType != 1111) {
key_digit_7 = (keypad.state as DecimalType).intValue
key7.postUpdate(key_digit_7)
key_count = key_count + 1
keycounter.postUpdate(key_count)
keyentered.postUpdate(key_digit_1.toString + "-" + key_digit_2.toString + "-" + key_digit_3.toString + "-" + key_digit_4.toString + "-" + key_digit_5.toString + "-" + key_digit_6.toString + "-" + key_digit_7.toString + "-" + key_digit_8.toString + "-" + key_digit_9.toString + "-" + key_digit_0.toString)
}
else if (keypad.state as DecimalType == 1111) {
key_count = key_count + 3
keycounter.postUpdate(key_count)
keyentered.postUpdate(key_digit_1.toString + "-" + key_digit_2.toString + "-" + key_digit_3.toString + "-" + key_digit_4.toString + "-" + key_digit_5.toString + "-" + key_digit_6.toString + "-" + key_digit_7.toString + "-" + key_digit_8.toString + "-" + key_digit_9.toString + "-" + key_digit_0.toString)
}
if ((keypad.state as DecimalType).intValue != 1111)
Perfect!
Chatgpt
If you put your whole code in chatgpt you have other issues.
I tried it, and it works.
Thanks.
@Domotekhome Perhaps mark the solution as the solution, so that it’s easier for others with the same problem to figure out?
Exactly!