Comments (6)
What version of @hakit are you using? I just checked my code and i must have run into something similar 2 weeks ago
function toRGB(entity: HassEntity): [number, number, number] | null { if (entity.attributes) { if ("hs_color" in entity.attributes && entity.attributes.hs_color !== null) { return hs2rgb([entity.attributes.hs_color[0], entity.attributes.hs_color[1] / 100]); } if ("color_temp_kelvin" in entity.attributes && entity.attributes.color_temp_kelvin !== null) { return temperature2rgb(entity.attributes.color_temp_kelvin); } if ("rgb_color" in entity.attributes && entity.attributes.rgb_color !== null) { return entity.attributes.rgb_color; } if ("rgbw_color" in entity.attributes && entity.attributes.rgbw_color !== null) { return rgbw2rgb(entity.attributes.rgbw_color); } if ("rgbww_color" in entity.attributes && entity.attributes.rgbww_color !== null) { return rgbww2rgb(entity.attributes.rgbww_color, entity.attributes.min_color_temp_kelvin, entity.attributes.max_color_temp_kelvin); } } return null; }
This is the toRGB function on the latest version, i suspect you haven't upgraded the packages :)
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 ;)
from ha-component-kit.
What version of @hakit are you using? I just checked my code and i must have run into something similar 2 weeks ago
function toRGB(entity: HassEntity): [number, number, number] | null {
if (entity.attributes) {
if ("hs_color" in entity.attributes && entity.attributes.hs_color !== null) {
return hs2rgb([entity.attributes.hs_color[0], entity.attributes.hs_color[1] / 100]);
}
if ("color_temp_kelvin" in entity.attributes && entity.attributes.color_temp_kelvin !== null) {
return temperature2rgb(entity.attributes.color_temp_kelvin);
}
if ("rgb_color" in entity.attributes && entity.attributes.rgb_color !== null) {
return entity.attributes.rgb_color;
}
if ("rgbw_color" in entity.attributes && entity.attributes.rgbw_color !== null) {
return rgbw2rgb(entity.attributes.rgbw_color);
}
if ("rgbww_color" in entity.attributes && entity.attributes.rgbww_color !== null) {
return rgbww2rgb(entity.attributes.rgbww_color, entity.attributes.min_color_temp_kelvin, entity.attributes.max_color_temp_kelvin);
}
}
return null;
}
This is the toRGB function on the latest version, i suspect you haven't upgraded the packages :)
from ha-component-kit.
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!
from ha-component-kit.
Home assistant used to completely remove properties when the device is off, I'll have to take another look into it!
from ha-component-kit.
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 useEntity
.
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 useEntity
used to work just fine.
from ha-component-kit.
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 :)
from ha-component-kit.
Related Issues (20)
- Allow numeric value for media_content_id HOT 2
- Entity icon only updates when refreshing the page HOT 5
- TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" HOT 17
- Problem using the dashboard in companion app HOT 28
- Modal - Animation Control HOT 1
- Discord link is expired HOT 1
- Vacuum Card - New card to control Vacuum entities HOT 1
- Prevent sidebar/group collapsing HOT 5
- POC - Swap store to signals HOT 1
- Multi lingal HOT 1
- Option to disable animations HOT 5
- Authorization request after each page refresh HOT 7
- access to HA without logging in (use token) HOT 4
- AlarmCard
- Card title and description HOT 3
- useDevice hook HOT 6
- Style rgb variables for error/warning/success HOT 4
- Deploy docs update: SSH add-on HOT 3
- Theme provider flashes HOT 1
- ThemeProvider - precompile and make more dynamic
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ha-component-kit.