Skip to content
Permalink
Browse files

Fix OpenLCB Light Control xml load

  • Loading branch information...
icklesteve committed Jun 1, 2019
1 parent 1a2bda2 commit b9bf9a718214538cb5a632242a38a14d9de6235a
Showing with 10 additions and 1 deletion.
  1. +10 −1 java/src/jmri/jmrix/openlcb/OlcbLight.java
@@ -72,7 +72,10 @@ public void update(Boolean value) {
setState(value ? Light.ON : Light.OFF);
}
};

// A Light Control will have failed to set its state during xml load
// as the LightListener is not present, so we re-activate any Light Controls
deactivateLight();
activateLight();
}


@@ -84,6 +87,12 @@ public void update(Boolean value) {
*/
@Override
protected void doNewState(int oldState, int newState) {
// during xml load any Light Controls may attempt to set the Light before the
// lightListener has been set
if (lightListener==null){
log.debug("lightListener not set, probably still initialising");
return;
}
switch (newState) {
case Light.ON:
lightListener.setFromOwnerWithForceNotify(true);

0 comments on commit b9bf9a7

Please sign in to comment.
You can’t perform that action at this time.