Skip to content

Instantly share code, notes, and snippets.

@awarecan
awarecan / long_live_access_token.py
Created Aug 29, 2018
Get long-lived bearer token for home-assistant power user
View long_live_access_token.py
import os
from datetime import timedelta
from homeassistant import auth, core, config as conf_util
CLIENT_ID = 'long_lived_client'
LIFE_TIME = timedelta(days=3650)
async def create_refresh_token(auth_mgr: auth.AuthManager,