def METHOD_NAME(self):
    _state = "ON"
    val = self.current_value
    if self.red_limits:
        llim, hlim = self.red_limits
        if  llim > val or hlim < val:
            _state = "ALARM"
    if _state != "ALARM" and self.yellow_limits:
        llim, hlim = self.yellow_limits
        if  llim > val or hlim < val:
            _state = "WARNING"
    if self._red_states and self._state in self._red_states:
        _state = "ALARM"
    elif self._yellow_states and self._state in self._yellow_states:
        _state = (_state == "ALARM" and _state or "WARNING"
    if _state != self.current_state:
        self.current_state = _state
        self.emit("stateChanged", _state)