-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
base: dev
Are you sure you want to change the base?
Show logbook component in more info for non-numeric values #22997
Conversation
@@ -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)) || |
There was a problem hiding this comment.
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 = ( | |||
|
There was a problem hiding this comment.
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
Breaking change
this is a fix for another already closed pull request:
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
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: