Skip to content

Conversation

@mypi-home
Copy link

@mypi-home mypi-home commented May 30, 2025

feat: Allow negative values for primary individual entities (fix for issue 704)

This change introduces the accept_negative option for primary individual device configurations.

Previously, primary individual entities would always display the absolute power value. With this update:

  • The IndividualDeviceType now includes an accept_negative boolean property with UI component added to enable this.
  • If accept_negative: true is set in the card configuration for an individual device, the card will now display its actual state, including negative values.
  • If accept_negative is false or not specified (defaulting to false), the card will continue to display the absolute value as before.

This aligns the behavior of primary individual entities with secondary info entities regarding the handling of negative values.

Additionally fixed decimal handling to also work for negative values.

TO-DO: Fix logic for display zero not to consider negative numbers as zero.

This change is tested in Local js file in HASS - test results posted on the issue here:
#704

@Stuart0411
Copy link

@mypi-home does this only work for secondary information? It doesnt seem this can be used for the individual entity, and also doesnt change the direction of flow in the animation

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants