Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support of attribute tree when available #996

Merged
merged 20 commits into from
Aug 10, 2023

Conversation

onlinux
Copy link
Contributor

@onlinux onlinux commented Aug 10, 2023

I confess i am not an expert of github.
Yesterday, I submitted a pull request. In order to begin with a clean slate, I chose to re-clone the project. However, I noticed that this action resulted in the removal of all previous comments. I apologize for any inconvenience this may have caused.

When devices have attributes defined as attr1.attr2.attr3 etc... you can define the attribute as attr1.attr2.attr3 etc

Ex: for RPI monitor :

type: custom:mini-graph-card
entities:

entity: sensor.rpi_raspi64_rpi_monitor_raspi64
attribute: cpu.load_1min_prcnt
name: Load Raspi64
entity: sensor.rpi_monitor_raspi65
attribute: cpu.load_1min_prcnt
name: Load Raspi65
unit: '%'

This will prevent the need to create numerous virtual sensors for each sub-attribute you wish to access.

@onlinux onlinux changed the title Add support of attribute tree when available A new feature: Add support of attribute tree when available Aug 10, 2023
@onlinux onlinux changed the title A new feature: Add support of attribute tree when available feat: Add support of attribute tree when available Aug 10, 2023
@akloeckner
Copy link
Collaborator

However, I noticed that this action resulted in the removal of all previous comments.

The comments are in #995 .

Could you also please rebase your work on the dev branch? We have some erroneous commits in main that you have in your branch as well. (We should sort this out. But for now, we haven't yet...)

@onlinux
Copy link
Contributor Author

onlinux commented Aug 10, 2023

Yes, this is what i am trying to do but don't know yet how to rebase it. As i said i am really not an expert of github, sorry.
I guess i t is ok by now.

ildar170975 and others added 11 commits August 10, 2023 11:25
Displaying a sensor's state without displaying it's graph
  - to be confirmed
  - More info needed
  - invalid
Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 4.2.0 to 5.2.0.
- [Release notes](https://github.com/amannn/action-semantic-pull-request/releases)
- [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/main/CHANGELOG.md)
- [Commits](amannn/action-semantic-pull-request@v4.2.0...v5.2.0)

---
updated-dependencies:
- dependency-name: amannn/action-semantic-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@akloeckner
Copy link
Collaborator

No worries. I pulled the master changes into dev. That should prevent us from this rebasing hassle in the future. 💪

src/main.js Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
@onlinux
Copy link
Contributor Author

onlinux commented Aug 10, 2023

Yes you are right. Maybe i didn't correctly flush the cache of the browser when i was testing.
Made the changes and test it, ok.
I rebased the dev and master branch, hope this is good!

Thank you

@akloeckner
Copy link
Collaborator

Looks good! Can you also remove that other if?

I'll want to do a test tonight.

@onlinux
Copy link
Contributor Author

onlinux commented Aug 10, 2023

Done

@akloeckner
Copy link
Collaborator

Great, thanks a lot!! I'll try this as soon as I can and merge.

(@ildar170975, I take your comment on this being a great feature as approval in the sense of #937.)

@akloeckner
Copy link
Collaborator

I somehow had a hard time to load the dev version into my HA instance. But I finally can confirm your contribution to work here as well! Thanks a lot for this great feature!

@akloeckner akloeckner merged commit 9c1c31e into kalkih:dev Aug 10, 2023
4 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 10, 2023
# [0.12.0-dev.4](v0.12.0-dev.3...v0.12.0-dev.4) (2023-08-10)

### Features

* Add support of attribute tree when available ([#996](#996)) ([9c1c31e](9c1c31e))
@github-actions
Copy link

🎉 This PR is included in version 0.12.0-dev.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@paqpaqpaq
Copy link

paqpaqpaq commented Aug 19, 2023

Does this mean it now would be possible to get ahold of the values under "precip" from this sensor in order to plot a graph? And if so, how would one go about?

Attributes:

data:
  success: true
  start: 1692434100
  start_human: '10:35'
  temp: 25
  delta: 300
  precip:
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0.3
    - 0.4
    - 0.3
    - 0.4
    - 0.5
    - 0.3
    - 0.3
    - 0.4
    - 0.2
    - 0.4
    - 0.4
    - 0.2
  levels:
    light: 0.25
    moderate: 1
    heavy: 2.5
  grid:
    x: 425
    'y': 552
icon: mdi:weather-cloudy
friendly_name: neerslag_buienalarm_regen_data

@akloeckner
Copy link
Collaborator

No, unfortunately.

This means, we can now access complex attributes. Before, we could only access attributes, which directly contained one numerical datum.

To plot a graph, we still need the individual points to be recorded at individual times in history.

Sorry for not having responded in #1001. I didn't want to distract from getting the docs improvement merged.

github-actions bot pushed a commit that referenced this pull request Jan 27, 2024
# [0.12.0](v0.11.0...v0.12.0) (2024-01-27)

### Bug Fixes

* add first datapoint tooltip for line graph ([#882](#882)) ([7576fe6](7576fe6))
* allow zero tooltip ([057a395](057a395)), closes [#805](#805)
* cards would always assume icon_image was set ([#957](#957)) ([f376732](f376732))
* drop out-of-bound coords in reducer ([#881](#881)) ([527f005](527f005)), closes [#251](#251)
* retain the last out-of-bounds state ([#961](#961)) ([8ebe173](8ebe173)), closes [#881](#881) [#960](#960)
* **documentation:** enquote html color ([dbdeab8](dbdeab8)), closes [#872](#872)
* **stalebot:** issues should also use exemptLabels ([4d74c1f](4d74c1f))
* **workflows:** remove invalid description field ([e755e24](e755e24))

### Features

* Add support of attribute tree when available ([#996](#996)) ([9c1c31e](9c1c31e))
* pull two years worth of changes into release channel ([f5fb98d](f5fb98d)), closes [#1059](#1059)
* **option:** override icon with an image URL ([#789](#789)) ([2860a09](2860a09))
Copy link

🎉 This PR is included in version 0.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants