mirror of
https://github.com/FakeTV/pseudo-channel.git
synced 2025-12-29 14:33:16 +00:00
Update README.md
This commit is contained in:
@@ -57,7 +57,7 @@ Features are being added to the xml but as of now there are a few. Within the XM
|
||||
|
||||
## Power Saving / Using an External Controller:
|
||||
|
||||
*Warning: this section is useful only when getting the app working well manually. I highly recommend sticking with the manual methods of running PseudoChannel.py before attempting these features. It also helps to fully understand how the app works before implementing an external controller. You can better understand this app by tinkering with the methods above before attempting this part. When in doubt, just reach out to me in by creating an issue in this repo.*
|
||||
*Warning: this section is useful only when getting the app working well manually. I highly recommend sticking with the manual methods of running PseudoChannel.py before attempting these features. It also helps to fully understand how the app works before implementing an external controller. You can better understand this app by tinkering with the methods above before attempting this part. When in doubt, just reach out to me here by creating an issue in this repo.*
|
||||
|
||||
If you'd like to use your PseudoChannel but do not want your media playing when you're not watching it, you have a handful of options to make the channel even cooler. When you run the app using `python PseudoChannel.py -r` it checks the `daily_schedule` that was generated for the day to see where the playhead is when you execute the app... if it happens to be `1:17 PM` when you run the app and "Seinfeld" started at `1:10 PM`, then the app will start playing the scheduled "Seinfeld" episode exactly 7 minutes in as it is scheduled for the day (down to the second). This is nice but what if you want to start / stop the app dynamically using a button hooked up to your Raspberry Pi? Or perhaps you'd like to setup a voice command using your Amazon Echo. All you have to do is trigger the `startstop.sh` bash file. So let's say you decided to use an IR Led reciever to catch commands sent by your TV remote. After you configure the IR circuit on your Raspberry Pi, you would set it to execute the `startstop.sh` file - this will then either start PseudoChannel.py & resume the daily schedule if it isn't already running, or stop the currently running PseudoChannel.py instance if it is running. Doing this will pick up the playhead exactly where it would be as if the app never stopped. However, if you decided to use PseudoChannel in this way you need to manually setup a crontab to trigger the daily update every night at `12:00 AM`. Since the app isn't running unless you trigger it, it needs to know to update the daily schedule and advance forward in the queue. To do this, there is another bash file named, `generate_daily_sched.sh`. This is the file that should be setup with crontab to be triggered every evening at midnight. Essentially, this file will check to see if the app has been started via, `startstop.sh` - if so it will do nothing as the running app will know to update when the clock hits midnight; if however, it finds that the `startstop.sh` script did not spawn an instance of the app, it will trigger, `python PseudoChannel.py -g` which will generate the daily schedule. It's important to note that you should only use the two bash scripts, `startstop.sh` & `generate_daily_sched.sh` with each other. If you have previously started the app using the command, `python PseudoChannel.py -r`, you should kill it before using the, `startstop.sh` or the `generate_daily_sched.sh`. So basically, if you decide to use this neat power-saving / dynamic controlling feature using the bash scripts, then stick with that. If you accidentally have an instance of the app running using `PseudoChannel.py` with the `-r` flag and also have the bash file setup with a crontab, you will unwittingly trigger the app to generate the daily schedule twice at the same time when the clock hits midnight. Before attempting any of this I recommend keeping it simple and just manually running the app. This will also help you easily view debug info incase you run into XML issues or other unforseen errs. Once everything seems to be running great, then move to this method.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user