rule "Gramy!" when Item Kodi_State changed to Play then sOWFS01.sendCommand(OFF) Mpd_quodlibet_StartStop_expected.postUpdate(Mpd_quodlibet_StartStop.state) Mpd_quodlibet_StartStop.sendCommand(OFF) sBCacheWriteback.sendCommand(ON) end rule "Nie gramy" when Item Kodi_State changed to Stop /* or Item Kodi_State changed to Pause */ then /* bezpośrednie odwoływanie się do tych zmiennych powoduje jakieś nulle */ var preCB = sOWFS01_expected.state.toString() /* ponizsze generuje w linijce z ifem: The name ' == ' cannot be resolved to an item or type. var OnOffType preQL = Mpd_quodlibet_StartStop_expected.state */ var preQL = Mpd_quodlibet_StartStop_expected.state.toString() logInfo("niegramy", "Restore QL to {}", preQL) /* Mpd_quodlibet_StartStop.sendCommand(preQL.toString())*/ /* nie działa: preQL as StringType preQL.toString() */ if (preQL == "ON") { sendCommand(Mpd_quodlibet_StartStop, ON) } else { // logInfo("niegramy", "Did not restore QL. why?") } logInfo("niegramy", "Restore sOWFS01 to {}", preCB) /* sOWFS01.sendCommand(preCB) */ /* sOWFS01.sendCommand(sOWFS01_expected.state.toString()) zakomentowane, bo null instance */ /* sendCommand(sOWFS01, preCB) */ if (preCB == "ON") { sendCommand(sOWFS01, ON) } sBCacheWriteback.sendCommand(OFF) end