AalianKhan / mushroom-strategy

A strategy to automatically generate a dashboard using mushroom cards
MIT License
364 stars 36 forks source link

Add Device Card #92

Open AalianKhan opened 9 months ago

AalianKhan commented 9 months ago

Add a device card. when enabled via device options, creates a device card in the room for the particular device and the tap action creates a popup to show entities linked to that device.

TODO:

AalianKhan commented 9 months ago

@DigiLive I want to create a function to create all the domain cards since I need it for the device card again. I tried adding it in mushroom-strategy.js but I was getting errors about it not being defined when I try to call it. When you have time, can you take a look?

DigiLive commented 9 months ago

You've created createDomainCards as a method of class MushroomStrategy, so you call it as this.createDomainCards(), or if it's a static method as MushroomStrategy.createDomainCards().

I've attached an example of which you have to remove the .txt extension: mushroom-strategy.js.txt

Also, PR #81 is a massive change of the code base which is impossible to merge with the main branch. Especially when other PR's change this branch a lot also. I would appreciate it if you can wait for that PR to be reviewed and fully tested so it can be merged. After merging start implementing new features again.

DigiLive commented 9 months ago

btw... going to Browser Mod in the side bar, my console get spammed with manymanymany errors. I think it's related to https://github.com/thomasloven/hass-browser_mod/issues/652

AalianKhan commented 9 months ago

Thank you very much. Sure I will wait for that PR. Mine works okay, hopefully gets fixed soon

DigiLive commented 9 months ago

I guess the errors have something to do with localization. Still a heavy integration for just a popup, though. But we'll see.

Thanks for waiting on my PR. I hope you can test and review it soon. Your help might also be needed to merge/force push.

DigiLive commented 8 months ago

[!WARNING] The main branch has been switched to TypeScript. Update your feature branch accordingly!

DigiLive commented 8 months ago

FYI... Maybe I've found a way to use just a part of browser mod.

If so, we can use it in this project directly without the user having to install browser mod. And it's more lightweight.

AalianKhan commented 8 months ago

Oh nice, Can you send me more details?

DigiLive commented 8 months ago

Oh nice, Can you send me more details?

Yeah sure. But I have to play and find out a little myself first. 😅 Once I get a short sample running, you'll get to know it.

DigiLive commented 8 months ago

It takes a little longer. I've decided to create a card for Home Assistant myself to fit the requirements for this PR.

It's still gonna be a card which we can use in the code directly. So no need to require another HACS repo to be installed.

AalianKhan commented 7 months ago

Whenever you finish with the popup, just shoot me a message. Thanks

DigiLive commented 7 months ago

Whenever you finish with the popup, just shoot me a message. Thanks

Yeah...

I've been quite busy lately. Planning to pick it up soon.