NCO
(E. Gerland)
1
All,
I bet I saw this somewhere, but i don’t find it anymore.
Currently I use a code like (fr is a string, CarDrFrRght a contact):
if(fr == "Closed") {
CarDrFrRght.postUpdate(CLOSED)
}
if(fr == "Open") {
CarDrFrRght.postUpdate(OPEN)
}
Shouldn’t it be possible to use:
CarDrFrRght.postUpdate(fr)
But I get:
Cannot convert 'Open' to a state type which item 'CarDrFrRght' accepts: [OpenClosedType, UnDefType].
opus
(Jürgen Baginski)
2
Have tried to use something like:
ucase(fr)
NCO
(E. Gerland)
3
Thanks - I just found the solution:
CarDrFrRght.postUpdate(fr.toUpperCase)
1 Like
NCO
(E. Gerland)
4
I just recognized that average CPU load went from 20 up to 45-50 after the change.
Is that even thinkable or just a coincidence?
opus
(Jürgen Baginski)
5
I would say it depends a bit on how often you run that code.
NCO
(E. Gerland)
6
Good Morning
Same like the original code with 6 LOC - every 5 minutes
opus
(Jürgen Baginski)
7
Although I’m having no knowledge about what this method does in the backgound I would relate that to such a change in the AVERAGE load.
opus
(Jürgen Baginski)
9
Sorry, wouldn’t. It’s a bit early!
NCO
(E. Gerland)
10
That would have been my first guess as well.
Thanks.
I will revert back and see what happens.
EDIT:
i changed back to the previous setup, but the Cpu load is the same.
So there must be something else wrong.