If I change to self.flags = tools.argparser.parse_args(args=[])
I believe it was what you meant, then I am presented with the same authorization process that finally tries to redirect to localhost:8080 without sucess.
Changing auth: False, presents the same authorization flow as if the previous one hasn’t been done.
So not sure how to continue or if I am missing something.
the error was expected, but i hoped it would go through.
without args the program tries to open a browser and you need to logon there.
so i tried to add the argument that is needed but the argument that we have set for AD conflicts and gives an error.
there is 1 other option that i tried to avoid.
i uploaded an extra file called “start_calendar.py”
the dir in that files needs to be changed
save that in the same dir and with AD down give this command in a terminal
but i am afraid that that option will be difficult for hassio users.
@cee i really dont know why you get that strange error. and i would love to figure it out, but after i get back.
so i dont have time for it untill friday. i am sorry.
please believe me that that is possible and that the app tries that.
dont forget, this was the message you got before:
018-06-03 22:41:03.074904 INFO hoofdagenda: no valid credentials, so get them
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?client_id=xxxxxxxx.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar.readonly&access_type=offline&response_type=code
If your browser is on a different machine then exit and re-run this
application with the command-line parameter
–noauth_local_webserver
that was the sign for me that it was working.
if you would have a browser installed and a monitor, and keyboard on your device, you would have been authorised now.
So i wasn’t sure if I was having permission issue’s or something, my linux skill’s are not great, still learning everyday. So I did a fresh install of hasbian just now, then did a fresh install of AppDaemon using sudo hassbian-config install appdaemon so I knew it was running under the same user, and the same venv, thats all thats installed, then dropped in the calendar app, and still the same formatyear error
2018-06-04 22:12:21.421449 WARNING AppDaemon: ------------------------------------------------------------
2018-06-04 22:12:21.422158 WARNING AppDaemon: Unexpected error initializing app: hoofdagenda:
2018-06-04 22:12:21.422795 WARNING AppDaemon: ------------------------------------------------------------
2018-06-04 22:12:21.426427 WARNING AppDaemon: Traceback (most recent call last):
File "/srv/appdaemon/lib/python3.5/site-packages/appdaemon/appdaemon.py", line 2040, in check_app_updates
self.init_object(app)
File "/srv/appdaemon/lib/python3.5/site-packages/appdaemon/appdaemon.py", line 1565, in init_object
self, name, self.logger, self.error, app_args, self.config, self.app_config, self.global_vars
TypeError: formatyear() takes from 2 to 6 positional arguments but 9 were given
2018-06-04 22:12:21.427346 WARNING AppDaemon: ------------------------------------------------------------
(appdaemon) homeassistant@hassbian:~/appdaemon/apps/google-calendar-app $ python3 start_calendar.py --noauth_local_webserver Traceback (most recent call last):
File "start_calendar.py", line 6, in <module>
from apiclient.discovery import build
File "/srv/appdaemon/lib/python3.5/site-packages/apiclient/__init__.py", line 8, in <module>
from googleapiclient import discovery
File "/srv/appdaemon/lib/python3.5/site-packages/googleapiclient/discovery.py", line 32, in <module>
from six.moves import http_client
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/srv/appdaemon/lib/python3.5/site-packages/six.py", line 203, in load_module
mod = mod._resolve()
File "/srv/appdaemon/lib/python3.5/site-packages/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/srv/appdaemon/lib/python3.5/site-packages/six.py", line 82, in _import_module
__import__(name)
File "/usr/lib/python3.5/http/client.py", line 71, in <module>
import email.parser
File "/usr/lib/python3.5/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/lib/python3.5/email/feedparser.py", line 27, in <module>
from email import message
File "/usr/lib/python3.5/email/message.py", line 16, in <module>
from email import utils
File "/usr/lib/python3.5/email/utils.py", line 33, in <module>
from email._parseaddr import quote
File "/usr/lib/python3.5/email/_parseaddr.py", line 16, in <module>
import time, calendar
File "/home/homeassistant/appdaemon/apps/google-calendar-app/calendar.py", line 2, in <module>
import httplib2
File "/srv/appdaemon/lib/python3.5/site-packages/httplib2/__init__.py", line 879, in <module>
class HTTPConnectionWithTimeout(http.client.HTTPConnection):
AttributeError: module 'http' has no attribute 'client'
thats not good.
because you DONT want to have hass and AD in the same venv, but seperate.
and you need to install the google-api-client for sure.
it is possible though that now it tries to use a version that HA installed and might be outdated.
and your last error shows that google-api-client isnt installed correctly
that way libraries from AD and HA will never conflict.
for configuration directories i use 2 different dirs side by side.
for example
/configs/appdaemon
/configs/homeassistant
and then i start HA like
hass -c /configs/homeassistant
and AD
appdaemon -c /configs/appdaemon
that way you cant get right confilcts and still have it all together.
do you already use winscp?
its a great program to get from a pc to a pi with scp.
when you use the advanced option to login with sudo -su you get into it as root user and you can view all files in all dirs and directly see all filerights.
i couldnt live without it even though my linux machine has a monitor, mouse and keyboard.
because of the fact that it wasnt working on some platforms i thought it was nice to offer my app.
i didnt think it would completly hijack your thread.
as soon as i am back i will let this split up and get you your topic back.
dont worry you missed nothing except us trying to get it to work
so @cee and @claudiopi as soon as i have something i will open a new topic and have our previous postings moved there. for other please dont refer to my app here.
I picked up a super cheap Android 10" tablet to replace my iPad, so means I can run fully kiosk browser now, so meant I could fake the user string, and finally get a calendar working on my Dashboard.
Many many thanks @WazWaz it will help me out tremendously, now to just make it all look pretty
p.s. its not really blank, i just blanked out my events.