Giter Site home page Giter Site logo

Comments (15)

shannonhochkins avatar shannonhochkins commented on July 4, 2024 1

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.

shannonhochkins avatar shannonhochkins commented on July 4, 2024 1

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

https://github.com/home-assistant/frontend/blob/0735705dd3f74e5474e20f330bb1816996ceeb2c/src/panels/config/areas/ha-config-area-page.ts#L92

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.

koriwi avatar koriwi commented on July 4, 2024 1

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.

shannonhochkins avatar shannonhochkins commented on July 4, 2024

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.

shannonhochkins avatar shannonhochkins commented on July 4, 2024

Release: https://github.com/shannonhochkins/ha-component-kit/releases/tag/3.0.5

from ha-component-kit.

koriwi avatar koriwi commented on July 4, 2024

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.

shannonhochkins avatar shannonhochkins commented on July 4, 2024

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.

koriwi avatar koriwi commented on July 4, 2024

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.

koriwi avatar koriwi commented on July 4, 2024

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.

shannonhochkins avatar shannonhochkins commented on July 4, 2024

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.

koriwi avatar koriwi commented on July 4, 2024

i did. but i will check again :)
https://meet.google.com/edt-cktm-pef
will be there in 30min

from ha-component-kit.

koriwi avatar koriwi commented on July 4, 2024

there it is

from ha-component-kit.

shannonhochkins avatar shannonhochkins commented on July 4, 2024

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.

shannonhochkins avatar shannonhochkins commented on July 4, 2024

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.

shannonhochkins avatar shannonhochkins commented on July 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.