added notifications

added freepbx integration as notification source
This commit is contained in:
Brandon4466
2023-08-11 02:17:41 -07:00
parent 0039308633
commit 4467115135
9 changed files with 91 additions and 23 deletions

View File

@@ -210,26 +210,29 @@ def get_devices():
# unloadDevices_list()
# loadSleep()
# root.after(3600, get_devices)
if spotify.current_playback() != None:
count = 0
# unloadSearching_Devices()
unloadDevices_list()
loadNow_playing()
root.after(800, update_song_label)
else:
count += 1
if count > 420:
kill(kill=sleep)
# unloadSearching_Devices()
# loadDevices_list()
try:
if spotify.current_playback() != None:
count = 0
# unloadSearching_Devices()
unloadDevices_list()
loadNow_playing()
root.after(800, update_song_label)
else:
devices_list.delete(0, ttk.END)
list_of_devices = spotify.devices()
for num_of_device, garbage in enumerate(list_of_devices["devices"]):
# exec(f'dev_{num_of_device} = tk.Button(root, text=list_of_devices["devices"][num_of_device]["name"], command=start_playback_on_device(device_id=num_of_device))')
# exec(f'dev_{num_of_device}.grid(row={num_of_device}, column=1)')
devices_list.insert(num_of_device, list_of_devices["devices"][num_of_device]["name"])
root.after(8500, get_devices)
count += 1
if count > 420:
kill(kill=sleep)
# unloadSearching_Devices()
# loadDevices_list()
else:
devices_list.delete(0, ttk.END)
list_of_devices = spotify.devices()
for num_of_device, garbage in enumerate(list_of_devices["devices"]):
# exec(f'dev_{num_of_device} = tk.Button(root, text=list_of_devices["devices"][num_of_device]["name"], command=start_playback_on_device(device_id=num_of_device))')
# exec(f'dev_{num_of_device}.grid(row={num_of_device}, column=1)')
devices_list.insert(num_of_device, list_of_devices["devices"][num_of_device]["name"])
root.after(8500, get_devices)
except:
root.after(5000, get_devices)
# def wakeup():
# global count
@@ -563,6 +566,7 @@ def unloadNow_playing():
song_label.grid_forget()
previous_button.grid_forget()
play_button.grid_forget()
pause_button.grid_forget()
next_button.grid_forget()
progress_bar.grid_forget()
lyrics_label.grid_forget()