Created
October 28, 2021 19:56
-
-
Save Michal-Szczepaniak/e8d0d9eff7fa1ef2545397f214178014 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xbmc | |
from pywizlight import wizlight, PilotBuilder | |
class XBMCPlayer( xbmc.Player ): | |
def __init__(self, *args): | |
xbmc.Player.__init__(self) | |
xbmc.log('Kodi WiZ __init__') | |
def onPlayBackStarted( self ): | |
xbmc.log('Kodi WiZ playbackStarted') | |
light = wizlight("192.168.68.4") | |
asyncio.run(light.turn_off(PilotBuilder())) | |
def onPlayBackEnded( self ): | |
xbmc.log('Kodi WiZ playbackEnded') | |
light = wizlight("192.168.68.4") | |
asyncio.run(light.turn_on(PilotBuilder())) | |
def onPlayBackStopped( self ): | |
xbmc.log('Kodi WiZ playbackStopped') | |
light = wizlight("192.168.68.4") | |
asyncio.run(light.turn_off(PilotBuilder())) | |
def onPlayBackPaused(self): | |
xbmc.log('Kodi WiZ playbackPaused') | |
light = wizlight("192.168.68.4") | |
asyncio.run(light.turn_off(PilotBuilder())) | |
player = XBMCPlayer() | |
monitor = xbmc.Monitor() | |
while(not xbmc.Monitor.abortRequested): | |
if xbmc.Monitor.waitForAbort(1): | |
break | |
del player |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment