Hi all,
I created a Lovelace Google Calendar component …
More info? See https://github.com/rdehuyss/homeassistant-lovelace-google-calendar-card
Hi all,
I created a Lovelace Google Calendar component …
More info? See https://github.com/rdehuyss/homeassistant-lovelace-google-calendar-card
Hi, any issues on running this on Hass.io? I’m getting the following error from my .js file:
"Uncaught TypeError: Failed to resolve module specifier “moment”. Relative references must start with either “/”, “./”, or “…/”.
I believe it comes from the first line in the .js
import moment from 'moment';
Wich file did you put to your www folder? The one from root of the project or from dist folder?
Hello @rdehuyss. I have a number of issues with card.
Could you help with adopting card for new auth system?
I will look into it later this week - reason to use rest api is that it returns 5 calendar events whereas the hass object only returns 1 (as far as I know)
Cheers,
R
Hi Lapatoc,
Since it was a small change, I changed the url to not being hard-coded anymore, it is now a relative url.
Since it is a relative url, I now hope that it will also work with the new Auth system as it is just a relative url and all existing security cookies/tokens should flow along. Can you test? The new version is available here: https://github.com/rdehuyss/homeassistant-lovelace-google-calendar-card/tree/master/dist
And are you talking about this auth system: https://developers.home-assistant.io/blog/2018/07/02/trying-new-auth.html?
Kind regards,
Ronald
Yes, the link to new auth system is correct.
Thank you for quick fix. I’ll test new version and report later today.
Well I’ve tested new version of card. Url problem solved but authentication problem still exists. Now I’m getting 401 response. HASS log are full of following entities:
Login attempt or request with invalid authentication from 192.168.111.12
I’ve located issue with new auth system. The problem is in fetch(url) in getAllUrls function. By default fetch do not send any headers. You have to define them manually. I’ve made ugly fix:
getBearerToken() {
var userToken = JSON.parse(localStorage.getItem('tokens'));
return userToken.access_token;
}
async getAllUrls(urls) {
var btoken = this.getBearerToken();
...
fetch(url, {headers: {'Authorization':'Bearer '+`${btoken}`}}).than(...
Hi Lapatoc,
the issue should be solved now… I am now using the hass.callApi function which takes care of oAuth integration.
I just pushed it to github again. If you have any issues, do not hesitate to contact me.
Grtz,
R
Thanks. Works great!
BTW. What is the purpose of slider on top of card? I can’t move it.
Ok, hint taken, I’ll make it optional: you are the second person who asks me
It gives you the progress throughout the day, it is based on the standard google android calendar.
What do you think? Keep it, make it optional, …
Didn’t realized that is day progress bar. Currently I have only all day events in my household calendar. Need to play with other type of events.
How to make that locale would considered? Week days names alway in English.
The progressbar is now optional:
configure it using: showProgressBar: false
on the same level as entities.
Also, caching is added for 15 minutes so that we don’t do DDos attack on google for each entity change.
Cheers,
R
Still need to look into that one. Which locale are you using?
Russian. Hass frontend has a token in local storage that identifies which translation to use.
Done! Try with the latest version…
You’re fast! I’m still in the tube))) Will test later.