That wouldn’t be part of your expression. That would have to be on the pump object itself. Normally you would have a state, which would be an int, on the pump object. This may be tied to a tag that provides the state or you could do an expression on the object itself. Then you would you styling for the object and set how the object responds based on different states.
If I was doing it with an object from Symbol Factory, I would do a custom property on the part of the pump that I want to change color. Then I would right click on it, go to customizers, then style customizer. From there you can set how your different states affect the pump.