-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
useEntity not working for light entities that are turned off #102
Comments
Thanks for the details! Easy fix, is this error thrown by a custom use case or are you using both packages? Just odd I haven't seen this that's all! |
Home assistant used to completely remove properties when the device is off, I'll have to take another look into it! |
I made my own custom card for the lights so at first I thought it had something to do with my own code but after some testing I noticed that it was an issue with I have both packages packages installed but I barely use any components from @hakit/components because I create my own custom cards. It's weird that Home Assistant shows the properties even with null values. I haven't seen this change mentioned in the changelogs while upgrading. Perhaps it's an issue specific to my installation, but |
What version of @hakit are you using? I just checked my code and i must have run into something similar 2 weeks ago
This is the toRGB function on the latest version, i suspect you haven't upgraded the packages :) |
It's also great to see that you've been designing something from scratch using the core! How's it been going? Had any other major issues? Would appreciate some feedback :) |
You're absolutely right, it was fixed after upgrading. I upgraded about 2 weeks ago and then started this issue (but never submitted it because I got distracted) and ran into the same issue again this week. This time I submitted it without checking if there was a new update. No major issues and even if I encounter one, you apparantly fix them before I can submit a Github issue ;) |
Describe the bug
When a light entity is turned off, it cannot read a value from
hs_color
because it's null. I believe this started happening after upgrading to Home Assistant OS 2023.11.0.When the light entity is turned it, it works as expected.
To Reproduce
Steps to reproduce the behavior:
useEntity('light.living_room_group')
or<ButtonCard entity='light.living_room_group' />
Expected behavior
I expect the ButtonCard to display the light entity in the "off" state without giving an error.
Screenshots / code examples
![image](https://private-user-images.githubusercontent.com/14264313/284000667-b82ba442-e082-4015-b760-c62e5a87a5ba.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NTE0MDIsIm5iZiI6MTcyMTc1MTEwMiwicGF0aCI6Ii8xNDI2NDMxMy8yODQwMDA2NjctYjgyYmE0NDItZTA4Mi00MDE1LWI3NjAtYzYyZTVhODdhNWJhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIzVDE2MTE0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQxZjIyZTlkOWZmZTdkMTUzNmJkNTdlMWYxMWFiZDMyODNhMTk3NGEzNmQzZjRiMGQzNmFkZDI1NzE5ODE4NjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.982ANVLcfbbwtkl12wZW-t9sdl2VXKHf0zkXpaaRdb0)
![image](https://private-user-images.githubusercontent.com/14264313/284000708-1e0e71ab-2c03-4739-986d-3f5bba224b04.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NTE0MDIsIm5iZiI6MTcyMTc1MTEwMiwicGF0aCI6Ii8xNDI2NDMxMy8yODQwMDA3MDgtMWUwZTcxYWItMmMwMy00NzM5LTk4NmQtM2Y1YmJhMjI0YjA0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIzVDE2MTE0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFiYjNmZWVmOTUzMWYwNmNiNjRlZDNiMGZjYWViNDkyYTEyZGJiNDNjMGM0OTlkMjE0NDJjZWI0M2NlY2NjY2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.tZgYHIO2vekyeiRU9t9UugxePfC9Ppuws6JGaR_aJgw)
System Info (please complete the following information):
Additional context
The error seems to be happening in
colors.ts
and might be fixed by using a fallback value.The text was updated successfully, but these errors were encountered: