2018-07-01 21:48:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
rule "Gramy!"
|
|
|
|
|
when
|
|
|
|
|
Item Kodi_State changed to Play
|
|
|
|
|
then
|
2021-04-10 15:23:23 +02:00
|
|
|
/* cottonballs */
|
2018-07-01 21:48:20 +02:00
|
|
|
sOWFS01.sendCommand(OFF)
|
2021-04-10 15:23:23 +02:00
|
|
|
/* prawe kanapowe */
|
|
|
|
|
sSONOFF09b.sendCommand(OFF)
|
2018-07-01 21:48:20 +02:00
|
|
|
|
|
|
|
|
Mpd_quodlibet_StartStop_expected.postUpdate(Mpd_quodlibet_StartStop.state)
|
|
|
|
|
Mpd_quodlibet_StartStop.sendCommand(OFF)
|
2019-08-13 18:46:42 +02:00
|
|
|
|
|
|
|
|
sBCacheWriteback.sendCommand(ON)
|
2018-07-01 21:48:20 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule "Nie gramy"
|
|
|
|
|
when
|
2019-10-14 13:40:27 +02:00
|
|
|
Item Kodi_State changed to Stop
|
|
|
|
|
/* or
|
|
|
|
|
Item Kodi_State changed to Pause */
|
2018-07-01 21:48:20 +02:00
|
|
|
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 '<XFeatureCallImplCustom> == <XFeatureCallImplCustom>' cannot be resolved to an item or type.
|
|
|
|
|
var OnOffType preQL = Mpd_quodlibet_StartStop_expected.state */
|
|
|
|
|
var preQL = Mpd_quodlibet_StartStop_expected.state.toString()
|
2021-04-10 15:23:23 +02:00
|
|
|
var preCL = sSONOFF09b_expected.state.toString() /* prawe couchlight */
|
2018-07-01 21:48:20 +02:00
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-10 15:23:23 +02:00
|
|
|
logInfo("niegramy", "Restore Right Couchlights to {}", preCL)
|
|
|
|
|
if (preCL = "ON") {
|
|
|
|
|
sSONOFF09b.sendCommand(ON)
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-13 18:46:42 +02:00
|
|
|
sBCacheWriteback.sendCommand(OFF)
|
2018-07-01 21:48:20 +02:00
|
|
|
end
|
|
|
|
|
|