Giter Site home page Giter Site logo

Comments (9)

erkr avatar erkr commented on July 18, 2024 1

Yes that template works fineπŸ‘Œ

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on July 18, 2024

@erkr Pretty sure I investigated this somewhere in the past. Could not find the issue/discussion again.
Anyways if I remember correctly there is another prerequisite in expand template function which I cannot comply (thought there is a check for platform group or something like that in code code).
Also for auto entities I have checked to support that.
I might revisit this though as I see why this can be very useful. Maybe there has been changes in HA where I can be able to get this working.

Also this would be a breaking change. People relying on entities in there template will need to adopt when I change this.

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on July 18, 2024

I did a quick test, but I cannot make this working for expand.

The culprit is here. Where HA checks specifically for group.* entities. Powercalc group sensors are part of sensor domain.
https://github.com/home-assistant/core/blob/dev/homeassistant/helpers/template.py#L1270

from homeassistant-powercalc.

erkr avatar erkr commented on July 18, 2024

Thanks for testing. Didn't know that expand() expects the group domain. Nice you recognise the added value for populating cards😊

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on July 18, 2024

For example how to do auto entities see here:
https://community.home-assistant.io/t/powercalc-virtual-power-sensors/318515/665?u=bramski

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on July 18, 2024

Thanks for testing. Didn't know that expand() expects the group domain. Nice you recognise the added value for populating cards😊

It was on the back of my mind somewhere. It's a pity, but they won't add any specific code for powercalc in core. Also, there is no possibility for custom components to provide entities in the group domain, that's something only core code can do.
So there is no solution unfortunately yet for the expand

from homeassistant-powercalc.

erkr avatar erkr commented on July 18, 2024

Group support for cards would already be very nice. 😊 I realise it is actually breaking change.

from homeassistant-powercalc.

erkr avatar erkr commented on July 18, 2024

To be honest, this integration is so useful, it should be part of core πŸ€—

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on July 18, 2024

Closing as it's not something I can fix. Example how to use with auto entities is shared above.

from homeassistant-powercalc.

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.