Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rgb-card-background-color to fix QR codes #66

Merged
merged 3 commits into from
Apr 6, 2024

Conversation

Nezz
Copy link
Contributor

@Nezz Nezz commented Apr 6, 2024

Add rgb-card-background-color to fix QR codes. It seems that this variable was meant to be the same as the card background color, but without the alpha component. I'm not sure why this variable is used to generate QR codes instead of hardcoded #000 and #fff, but I guess the idea behind doing that in home-assistant/frontend#19726 was dark mode support.

Resolves #60 and the issue mentioned in #64 (comment)

Note: I regenerated the themes in commit a869137. Maybe it's due to using a different OS, but this line

for background in Path("themes").glob("homekit-bg-*.jpg"):

returns the images in alphabetical order for me, whereas they were in a seemingly random order previously.

Commit 19f550b contains the clean diff of the theme files.

@Nezz
Copy link
Contributor Author

Nezz commented Apr 6, 2024

The QR code now works and can be scanned by the Tuya app with a dark mode theme. No screenshot proof this time to avoid doxxing myself.

@Nezz Nezz marked this pull request as ready for review April 6, 2024 12:31
@basnijholt
Copy link
Owner

Great! Could you perhaps change:

Path("themes").glob("homekit-bg-*.jpg")

to sorted(Path("themes").glob("homekit-bg-*.jpg")) to make it deterministic?

@Nezz
Copy link
Contributor Author

Nezz commented Apr 6, 2024

Sure, changed. There were no changes to the theme files.

@basnijholt basnijholt merged commit c010c99 into basnijholt:master Apr 6, 2024
@basnijholt
Copy link
Owner

Awesome! Thanks again 😄

@Nezz Nezz deleted the fix/rgb-card-background-color branch April 6, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QR code not shown when re-authenticating Tuya
2 participants