Closed squirrel289 closed 3 years ago
I have to study your proposed solution, in the meantime, please point me to other custom card implementing the concept and or code snippets to help me implement your suggestion.
Hey Squirrel, the bindActionHandler is obsolete (still using lit-element); also the even handlers of the card are all captured by the THREE.js orbit control to allow for model zoom, move and rotation. I can use the double-click only but I need to find an alternative way compared to your proposed approach.
Hey squirrel, please give me some advise if you are a card tool expert (the project is a little stalled: 2 years untouched now)
Hello @JVital2013 are you familiar with this type of implementations ?
I have not personally created any custom cards (thank you for ALL of the effort you’ve put into yours) but Thomas Lovén (https://github.com/thomasloven) is a bit of a legend
Unfortunately not, but maybe I can give a bit of insight.
I think we might have more flexibility than just double-click with THREE. See this example: https://jsfiddle.net/41aun97x/1/. It lets you do a single-click. I was even able to get some hover functionality by changing the addEventListener call on line 92 of the example.
If you can get this kind of Event Listener to work in Floor3D-Card, you could then couple it with this._hass.fireEvent
to perform hass-more-info, or this._hass.callService
to do some other action on an entity.
From there, I can envision a new type3d
called "custom" that lets you specify:
I'm not 100% sure how to implement this - just spit-balling
Hello guys, I do not think this is going to happen in the short term. I've added a link to this issue in the Project 2.0 (https://github.com/adizanni/floor3d-card/projects/2#card-73036987). But I close it here because I do not want to have very long running issues I know I cannot work on.
There is no direct way to access the user interaction within the model. It would be useful for such things as adding external info panels, popping up entity controls, etc.
Bind actions (I.e., via cardtools bindActionHandler) to entity-mapped objects in the model.
Other similar features requests have been made (like showing panel on hover). The approach of binding actions provides greater flexibility and would be a good starting point for the other requests as you could provide requested features as default behavior that users could override using custom actions.