Skip to content

Conversation

@hobbymachinist
Copy link

At the moment individual object power flows are unidirectional, since the state is always an absolute value. This change adds support for displaying the power flow direction accurately to support devices that can also be generators.

foXaCe added a commit to foXaCe/power-flow-card-plus that referenced this pull request Oct 25, 2025
Integrated commit c00dd74 from hobbymachinist/power-flow-card-plus (PR flixlix#873):
**Changes:**
- Modified `getIndividualState()` to return signed values (removed Math.abs)
- Added `absState` calculation in `getIndividualObject()` to handle negative states
- State values now retain directionality while display shows absolute values
- Enables proper animation inversion for bidirectional devices (V2H/V2G)
**Impact:**
- Individual objects can now properly display power flow direction
- Supports Vehicle-to-Home (V2H) and Vehicle-to-Grid (V2G) scenarios
- Animation correctly inverts when power flow reverses
**Note on commit 2342177 from dpayk/power-flow-card-plus:**
This commit fixes battery charging flow calculation, but a more comprehensive
solution was already applied via PR flixlix#878 which handles grid export and uses
more robust Math.max/Math.min logic.
Build verified successful.
foXaCe added a commit to foXaCe/power-flow-card-plus that referenced this pull request Oct 28, 2025
Integrated commit c00dd74 from hobbymachinist/power-flow-card-plus (PR flixlix#873):
**Changes:**
- Modified `getIndividualState()` to return signed values (removed Math.abs)
- Added `absState` calculation in `getIndividualObject()` to handle negative states
- State values now retain directionality while display shows absolute values
- Enables proper animation inversion for bidirectional devices (V2H/V2G)
**Impact:**
- Individual objects can now properly display power flow direction
- Supports Vehicle-to-Home (V2H) and Vehicle-to-Grid (V2G) scenarios
- Animation correctly inverts when power flow reverses
**Note on commit 2342177 from dpayk/power-flow-card-plus:**
This commit fixes battery charging flow calculation, but a more comprehensive
solution was already applied via PR flixlix#878 which handles grid export and uses
more robust Math.max/Math.min logic.
Build verified successful.
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.

1 participant