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

Show logbook component in more info for non-numeric values #22997

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

boern99
Copy link
Contributor

@boern99 boern99 commented Nov 25, 2024

Breaking change

this is a fix for another already closed pull request: image
Show logbook in more-info for non-numeric values:

Tried to export and use isNumeric from frontend/src/data/history.ts as suggested in #22762

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@boern99 boern99 marked this pull request as ready for review November 25, 2024 19:32
@boern99
Copy link
Contributor Author

boern99 commented Nov 26, 2024

ok, this way does not always work as expected: loads on some sensors endless till i open the logbook:
Screenshot_20241126_073748_Home Assistant
After opening the logbook it finishes loading :-(

@@ -111,7 +112,8 @@ export const computeShowLogBookComponent = (

const domain = computeDomain(entityId);
if (
CONTINUOUS_DOMAINS.includes(domain) ||
(CONTINUOUS_DOMAINS.includes(domain) &&
isNumericEntity(domain, stateObj, undefined, [], false)) ||
Copy link
Contributor

@karwosts karwosts Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ideally we'd like to also use the numericDevicesClasses cached list here, instead of just passing an empty array.

It is slightly tricky though as getting that is an async operation, so you'll have to probably do it at the caller and pass it into this function.

@@ -111,7 +112,8 @@ export const computeShowLogBookComponent = (

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a check for stateObj.attributes.unit_of_measurement a couple of lines up that would become redundant and should be removed as isNumericFromAttributes already checks that

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.

3 participants