Comments (15)
ahhh ok. im more or less utc :) so you are utc +10? sounds like a cunt to me 😜
yeah we just need to find a spot where our timezones dont fight each other. if i can get it done easily, you can take a look at the pr and see if you get my point. if not, we can hop on a call!
Haha easy as mate
from ha-component-kit.
I Just had a quick look tthrough the home assistant repository, they have this "memberships" method which looks pretty similar to what the useAreas hook is supposed to achieve
Might be worth taking a look at this to determine if it has the same logic you're expecting to see!
from ha-component-kit.
No worries! Also sorry for responding so late. My sister is moving and I'm helping. So I'm a bit more busy than usual
from ha-component-kit.
Hey man!
Thankyou for reporting the issue - I believe this is something I've introdcued as a feature for myself, but it's having unforseen side effects clearly - i've just released a new version of the core/components.
As for the hook useAreas
now has an additional returned value called deviceEntities
which is most likely the cause of your issue you're seeing as it will lookup related entities (children) of devices that are matched by default, i've now moved these to an individual property so you can optionally choose to use them or not
Hopefully this works for you!
from ha-component-kit.
Release: https://github.com/shannonhochkins/ha-component-kit/releases/tag/3.0.5
from ha-component-kit.
hey, it's not working as i expect, but i checked your commit and i think i can create a pr later. maybe after work :)
i just encountered a small error when setting the stuff up for developing.
i cloned your monorepo, build the core, and npm link it to my local dev dashboard. but i get this error
koriwi@MacBook-Pro-von-Kilian ha-dashboard % npm run dev
> [email protected] dev
> vite
VITE v5.0.0 ready in 146 ms
➜ Local: http://localhost:5173/local/ha-dashboard/
➜ Network: use --host to expose
➜ press h + enter to show help
✘ [ERROR] Could not resolve "@iconify/react"
node_modules/@hakit/components/dist/hakit-components.es.js:16:27:
16 │ import { Icon as dI } from "@iconify/react";
╵ ~~~~~~~~~~~~~~~~
You can mark the path "@iconify/react" as external to exclude it from the bundle, which will
remove this error and leave the unresolved path in the bundle.
from ha-component-kit.
Hey man, thanks that'd be great, unless we jump on a call to chat about the issue more because I might be misunderstanding the root issue!
Usually, this is because the project was built in different node / npm versions, I normally blow away build and package directories, and re-install and rebuild and re-link the workspace to rule out everything else
If all else fails, install the package manually on both sides, but I doubt that'll work
I will try checkout a new clone tomorrow and I'll see if I can replicate (it's 1030pm here now)
from ha-component-kit.
ahhh ok. im more or less utc :) so you are utc +10? sounds like a cunt to me 😜
yeah we just need to find a spot where our timezones dont fight each other. if i can get it done easily, you can take a look at the pr and see if you get my point. if not, we can hop on a call!
from ha-component-kit.
Ok. i couldnt figure out until now how to npm link a package of a monorepo with peer dependencies in vite...
so i think i need your quick help. a call would be perfect! im awake for 3 more hours!
from ha-component-kit.
Yo, I can jump on a call in 45, but can you check your node and npm version please? It's looks to me like incorrect versions or mismatch versions, both in ha-component-kit and your dashboard must be using the same node version and npm version, and the npm version should be > 7
from ha-component-kit.
i did. but i will check again :)
https://meet.google.com/edt-cktm-pef
will be there in 30min
from ha-component-kit.
there it is
from ha-component-kit.
After I've merged your PR, I tested it, and noticed what i was missing in my example
for (const entity of entities) {
if (entity.area_id) {
if (entity.area_id === area.area_id) {
matchedEntities.push(_entities[entity.entity_id]);
}
} else if (entity.device_id && matchedDevices.has(entity.device_id)) {
// if the matched devices contain the device, it's definitely already part of the area
// so we can add it as an indirect entity
deviceEntities.push(_entities[entity.entity_id]);
// HERE: im missing the check for tthe case where it does not have an area id but a matching device
}
}
And to achieve that, i'd need to lookup the device rather than a simple check either way so what you proposed (as you expected) is correct - sorry it just took me a while to replicate the issue :)
from ha-component-kit.
I'm re-opening this as I've just noticed that for myself, It doesn't appear to be working correctly - I noticed that when i displayed the counts for devices & entities, I'm getting some really obscure results.
For all of my areas, the "deviceEntities" more or less end up with basically every available device from my instance.
Are you seeing the same results?
from ha-component-kit.
After reading the code - it seems maybe you and I were confused with each other, but the current logic where it pushes items to the deviceEntities
array, this should be removed, as currently the logic basically will add every entity to that array as there's technically no logic wrapped around it, it at the very least should only add it if it's within the area, however I don't think it's necessary as we do the same check on the next links down, I'll remove this for the next release
from ha-component-kit.
Related Issues (20)
- Display the settings modal HOT 6
- useEntity not working for light entities that are turned off HOT 6
- Full example code similar to Demo dashboard HOT 2
- Docs and npm create are bonked HOT 3
- DevContainer HOT 6
- Adding order number for AreaCards in SidebarCard HOT 2
- Area Summary Card HOT 2
- License status HOT 2
- Allow numeric value for media_content_id HOT 2
- Extend entity types generator to include attributes too HOT 6
- Cannot open when added to Home Screen HOT 12
- Card for Calendar entries HOT 7
- Cannot connect to Home Assistant instances over "http://". HOT 9
- I want to use the library with next.js but i got error only in building HOT 9
- Add option to set and update attributes HOT 2
- Can I query a list of area and entities within a area? HOT 8
- Setup CLI issues HOT 10
- Getting a lot of errors when following the contribution documentation HOT 8
- MediaPlayerCard improvements HOT 22
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.