- Notifications
You must be signed in to change notification settings - Fork0
ciaranmcnulty/homeassistant-test-container
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
When testing a Home Assistant integration it can be useful tohave a containerised version with a user and long-lived token already configured.
This image isnot intended for production use.
docker run \ --publish 8123:8123 \ ghcr.io/ciaranmcnulty/homeassistant-test-container:latest
This container is used the same way asthe Home Assistant containerexcept that you can configure a test user:
| Variable | Default | Description |
|---|---|---|
HA_USER | test_user | A login user |
HA_PASSWORD | test_password | A login password |
HA_NAME | Test User | The display name |
HA_TOKEN | (see below) | A long-lived access token |
The default access token's value is:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhOWRkNzY0NDkwMTA0NTg2ODVmMmZjNjFhZTRkNWY2NiIsImlhdCI6MTc2MjE3MTYzNSwiZXhwIjoyMDc3NTMxNjM1fQ.ud4A0VlTCDwE-Ir94AC4R9QOui3rqnGd4ib24AvokLYIf for some reason you want to replace it, you will need to generate a JWT using a script similar to the following:
importjwtimporttimeimportsecretssecret_token=secrets.token_hex(64)payload= {"iss":secret_token,# the issuer is your secret token"iat":int(time.time()),# issued at (current time)"exp":int(time.time())+3600*24*365*10# expiration (10 years later)}jwt_token=jwt.encode(payload,secret_token,algorithm="HS256")print(jwt_token)
About
A container for testing home assistant integrations
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
Uh oh!
There was an error while loading.Please reload this page.