Hello,
I’m using the NetworkUpsBinding which gives the status from the connected ups back as a String.
When i call ups_status.toString
:
It returns OL when on line power or OB when on Battery Power, etc etc,.
In the PaperUI i see the state being represented as Online or On battery, and using the rest API i see that there is a StateDescription implemented.
I want to push the status to my phone so that i know that there is some-thing happening with the power, but i want to see the value based on the StateDescription.
I am able to get the correct value using:
ups_status.stateDescription.options.filter[stateOption | stateOption.value == ups_status.state.toString].get(0).getLabel()
Is there a simpler way than this?
When searching in the forums or documentation i could not find anything related to rules in combination with state description.
Thanks,
Michael