-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timetable from file - how to disable aladhan timesheet polling? #17
Comments
You may do a trial & error with 'method' value in config. If all available values not meet your need, unfortunately you should create a web service with the same output as http://api.aladhan.com/timings/ contains a more accurate prayer time for your home. |
Thank you. I actually went beyond that (as explained in my post). Finally I figured it out today: I made the updateSchedule function in MMM-Prayertime.js have a drastic regime; mine looks like this now:
What I do then is to replace the "TEST" lines with the actual values coming from a separate CSV file by running automatically every morning a separate script I created. |
So, your prayertime is a fixed time then? Since , the prayertime is particularly changed normally according to lunar shape/position. |
It is not fixed. Like mentioned in this issue's title as well as in the issue description (first post at the top), I wrote an external program that every morning reads the timetable from a separate CSV file and replaces the two lines above in MMM-Prayertime.js This approach by the way can also be used to solve the brother's issue on Diyanet times. |
Thank you milkywade. Your approach is exactly that what I had also in mind but as I'm a newby in JS programming I have no idea how to fix it. Is it possible that you send me your "external program" and give detailed advice how to incorporate that in slametps' mmm-prayertime, please ? I would be very pleased. |
Hi erkilic - see attached files. I run the python script periodically (e.g. at 5am) then restart MM for the changes to take effect. Have a look and let me know any questions. |
hi milkywade,
as I’m coming from language c, I couldn’t understand the following lines in your python script 😉
could you please explain the following lines:
for line in csv_content:
if line[6:10] != str(date.today().year): // I guess, here you check if the current date is reached, but what means 6:10 ??
continue
if stop:
azan_tomorrow_csv = line // I think with this assignment, content of line is copied to string „azan_tomorrow_csv“
break
line_dt = datetime.strptime(line[:10], "%d/%m/%Y") // datetime …… ???
if line_dt.date() == date.today():
stop = True
azan_today_csv = line
sorry for bothering you ;-(
thx in advance
gürkan
Von: milkywade <notifications@github.com>
Gesendet: Mittwoch, 13. Februar 2019 22:51
An: slametps/MMM-PrayerTime <MMM-PrayerTime@noreply.github.com>
Cc: Gürkan Erkilic <mail@erkilic.de>; Comment <comment@noreply.github.com>
Betreff: Re: [slametps/MMM-PrayerTime] timetable from file - how to disable aladhan timesheet polling? (#17)
Hi erkilic - see attached files. I run the python script periodically (e.g. at 5am) then restart MM for the changes to take effect. Have a look and let me know any questions.
diyanet.zip <https://github.com/slametps/MMM-PrayerTime/files/2862343/diyanet.zip>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#17 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/Asq2zE23KAf6LZUP3UBnO-3OWZrHLs5dks5vNIjRgaJpZM4aUZyX> . <https://github.com/notifications/beacon/Asq2zIlViHcELzMO4raQGSt8Z-KInuWcks5vNIjRgaJpZM4aUZyX.gif>
|
hi milkywade, slametps,
i’m struggling since 4 hours with installing pandas.
I have installed it with „pip install pandas“
it need some time but it has finished with „successful installed..“
pip list shows:
…
microdotphat (0.2.1)
mote (0.0.4)
motephat (0.0.2)
numpy (1.16.1)
oauthlib (2.0.1)
pandas (0.24.1)
pantilthat (0.0.7)
phatbeat (0.1.1)
pianohat (0.1.0)
picamera (1.13)
….
my python version is:
Python 2.7.13
unfortunately starting your
athan_parse_1.py
brings up the error:
import pandas as pd
ImportError: No module named 'pandas'
any idea why it seems not to accept my panda installation?
I hope you can help.
kind regards
gürkan
Von: milkywade <notifications@github.com>
Gesendet: Mittwoch, 13. Februar 2019 22:51
An: slametps/MMM-PrayerTime <MMM-PrayerTime@noreply.github.com>
Cc: Gürkan Erkilic <mail@erkilic.de>; Comment <comment@noreply.github.com>
Betreff: Re: [slametps/MMM-PrayerTime] timetable from file - how to disable aladhan timesheet polling? (#17)
Hi erkilic - see attached files. I run the python script periodically (e.g. at 5am) then restart MM for the changes to take effect. Have a look and let me know any questions.
diyanet.zip <https://github.com/slametps/MMM-PrayerTime/files/2862343/diyanet.zip>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#17 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/Asq2zE23KAf6LZUP3UBnO-3OWZrHLs5dks5vNIjRgaJpZM4aUZyX> . <https://github.com/notifications/beacon/Asq2zIlViHcELzMO4raQGSt8Z-KInuWcks5vNIjRgaJpZM4aUZyX.gif>
|
On your pandas issue, I just went through the python script and concluded that you can delete that first line as pandas is not used anywhere in that script. Just delete the first line or comment it out and the script will still work. I must have added it at some point in time for some reason but it's not needed anymore. |
Now regarding your questions on the script, here's an overview of its workings:
More in detail and to your specific questions, this is how the script works:
Last, I generate from the python scripts a couple of strings (lines 38 & 44 in the python file I supplied) that will replace lines 179 & 180 in the MMM-PrayerTime js file I supplied with the correct times for today and tomorrow. I open the JS file on line 53, first read it, then re-open it in write mode and finally in lines 57 to 62 of the python file, I rewrite lines 179 & 180 of the JS file with the strings I generated in lines 38 & 44 of the python file. I don't know if it's the best way to do it or the prettiest and it does need additional failsafes but it works for me. I guess best would be to build it in java script and integrate it in slamet's program directly but my JS is not as good as my python these days and I did not had the chance to spend a couple of hours to understand how MM modules work. Hope this helped ! |
Thank you very much milkywade, now I understood how it is working. |
Sure, glad it worked :-) |
Dear - first of all, many thanks for this program, God bless you.
I have more a question than an issue.
The time/method options proposed by this program did not allow me to land into an accurate timetable for where I live.
As a result, I have used the declarative self.todaySchedule "debug" options included in MMM-PrayerTime.js line 147. I wrote an external program that reads a CSV file and replaces the times mentioned in that line.
My question is the following: how can I disable the constant timesheet polling from http://api.aladhan.com/timings/ (line 129 in MMM-PrayerTime.js) without breaking the program ? I tried tinkering a little bit but every time the program breaks.
I'd like for this polling to stop altogether as the computer I'm using sometimes has poor wifi and then the magicmirror is stuck with a "Charging..." message (even though I'm overwriting the timetable locally!)
many thanks!!
The text was updated successfully, but these errors were encountered: