Skip to content

Instantly share code, notes, and snippets.

@awarecan
awarecan / long_live_access_token.py
Created August 29, 2018 20:49
Get long-lived bearer token for home-assistant power user
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,