1
0
mirror of https://github.com/fHDHR/fHDHR_NextPVR.git synced 2025-12-06 03:46:58 -05:00
fHDHR_NextPVR/fHDHR/api/hub/device/station_scan.py
deathbybandaid 0a41d8897d Core Rewrite
2020-10-20 15:16:10 -04:00

28 lines
734 B
Python

from multiprocessing import Process
class Station_Scan():
def __init__(self, settings, channels):
self.config = settings
self.channels = channels
self.chanscan = Process(target=self.runscan)
def scan(self):
print("Channel Scan Requested by Client.")
try:
self.chanscan.start()
except AssertionError:
print("Channel Scan Already In Progress!")
def runscan(self):
self.channels.get_channels(forceupdate=True)
print("Requested Channel Scan Complete.")
def scanning(self):
try:
self.chanscan.join(timeout=0)
return self.chanscan.is_alive()
except AssertionError:
return False