Files
openhab/rules/salon.kodi.rules

46 lines
1.2 KiB
Plaintext
Raw Normal View History

2018-07-01 21:48:20 +02:00
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)
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 '<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()
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)
}
end