Automated time management system based on your timetable with Google Smart Device using pychromecast
default.mov
Key points:
- icalevents (load calendar: share the link)
MP3 API: https://api.oick.cn/txt/apiz.php?text=xxxx&spd=1- MP3 API: https://tts.youdao.com/fanyivoice?word=%E4%BD%A0%E5%A5%BD%EF%BC%8C%E6%88%91%E6%98%AF%E4%BD%A0%E5%A5%BD&le=zh&keyfrom=speaker-target
- pychromecast:
mc.play_media(url,'video/mp4')
python code/run.py
If you have your Google Nest Hub in your room with the same wifi network, let's try this see if it works.
import time
import pychromecast
from icalevents.icalevents import events
es = events("webcal://p50-caldav.icloud.com/published/2/token", fix_apple=True)
url = 'https://api.oick.cn/txt/apiz.php?text=省去我开始要提醒你了,滴滴滴,' + es[0].summary + '&spd=1'
url = 'https://tts.youdao.com/fanyivoice?word=我开始要提醒你了,滴滴滴,' + es[0].summary + '&le=zh&keyfrom=speaker-target'
# Discover and connect to chromecasts named Living Room
# use pychromecast.get_chromecasts() to check the name
chromecasts, browser = pychromecast.get_listed_chromecasts(friendly_names=["Bedroom display"])
cast = chromecasts[0]
cast.wait()
# play media with message embedding
mc = cast.media_controller
mc.play_media(url,'video/mp4')
mc.block_until_active()
# quit app about 20 sec
time.sleep(20)
cast.quit_app()
- Timetable project - previous python icalendar
- customise your timetable using previous project
- monite your mac project - based on github resource
- Merge projects - done ✅