code: public DevState getState() throws DevFailed {
          MDC.setContextMap(contextMap);
          xlogger.entry();
          if (isCorrectlyInit.get() && initImpl.isInitDoneCorrectly()) {
              state = stateImpl.updateState();
              // read all attributes to check alarms only if on
              if (state == DevState.ON && stateCheckAttrAlarm) {
                  checkAlarms();
              }
          } else {
              state = stateImpl.getState();
          }
          return state;
      }
docs: Get State
  
  @return state
  @throws DevFailed