Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A container for testing home assistant integrations

NotificationsYou must be signed in to change notification settings

ciaranmcnulty/homeassistant-test-container

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.

Usage

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:

VariableDefaultDescription
HA_USERtest_userA login user
HA_PASSWORDtest_passwordA login password
HA_NAMETest UserThe display name
HA_TOKEN(see below)A long-lived access token

The default access token's value is:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhOWRkNzY0NDkwMTA0NTg2ODVmMmZjNjFhZTRkNWY2NiIsImlhdCI6MTc2MjE3MTYzNSwiZXhwIjoyMDc3NTMxNjM1fQ.ud4A0VlTCDwE-Ir94AC4R9QOui3rqnGd4ib24AvokLY

If 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

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp