Skip to content

Add battery-storage device constants - gladys-zendure external - #6

Open
Terdious wants to merge 5 commits into
GladysAssistant:mainfrom
Terdious:feat/solar-battery-constants
Open

Add battery-storage device constants - gladys-zendure external#6
Terdious wants to merge 5 commits into
GladysAssistant:mainfrom
Terdious:feat/solar-battery-constants

Conversation

@Terdious

@Terdious Terdious commented Jul 18, 2026

Copy link
Copy Markdown

Mirror of the battery-storage category added to Gladys core (GladysAssistant/Gladys#2682): the battery-storage category with battery-level, charge-power, discharge-power, charge-index, discharge-index and battery-energy-remaining types, in lib/device-constants.js and index.d.ts, with test coverage.

Needed by external integrations reporting battery storage telemetry, starting with the Zendure integration (Terdious/gladys-zendure).

Claude-Session: https://claude.ai/code/session_012157sX3FKhVYmndWLJdhfo

Summary by CodeRabbit

  • New Features
    • Added a new battery-storage device feature category.
    • Introduced new battery-storage feature types for battery state of charge, charge/discharge power, cumulative charged/discharged energy indices, and remaining stored battery energy.
  • Tests
    • Updated canonical constant string assertions to include the new battery-storage category and related feature-type identifiers.

Mirror of the solar-battery category added to Gladys core
(GladysAssistant/Gladys#2682): solar-battery category with
battery-level, battery-input-power and battery-output-power types,
in lib/device-constants.js and index.d.ts, with test coverage.

Needed by external integrations reporting solar battery telemetry,
starting with the Zendure integration (Terdious/gladys-zendure).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012157sX3FKhVYmndWLJdhfo
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a BATTERY_STORAGE device-feature category and feature-type group to runtime constants and TypeScript declarations, with tests covering battery level, power-flow, cumulative-energy, and remaining-energy canonical strings.

Changes

Battery storage constants

Layer / File(s) Summary
Define and validate battery storage constants
index.d.ts, lib/device-constants.js, test/device-constants.test.js
Adds the battery-storage category and battery level, power-flow, cumulative-energy, and remaining-energy feature types to runtime and TypeScript exports, with canonical string assertions.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A rabbit hops through storage bright,
With battery levels tucked in tight.
Power flows and energies align,
Typed and tested by sunlight divine.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding battery-storage device constants for the Zendure integration.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

claude added 3 commits July 20, 2026 10:28
…e category

Rename the SOLAR_BATTERY category to BATTERY_STORAGE ('battery-storage') and
expand its feature types to a full set of power/energy flow constants covering
charge/discharge, solar input, home output, grid import/export and off-grid,
mirroring the Gladys core. Update the TypeScript typings and tests accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012157sX3FKhVYmndWLJdhfo
…/discharge-index

Mirror of the core rename: `index` is the core's established vocabulary for a
cumulative kWh meter reading, so the two battery-storage counters become
charge-index / discharge-index. battery-energy-remaining is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012157sX3FKhVYmndWLJdhfo
@Terdious
Terdious force-pushed the feat/solar-battery-constants branch from cab59a1 to 588b603 Compare July 21, 2026 07:31
Mirror the core reordering (GladysAssistant/Gladys#2682): place battery-storage
next to the other battery categories (after battery-low) in both the JS
constants and the TypeScript typings. Pure reordering, no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Terdious Terdious changed the title Add solar-battery device constants - gladys-zendure external Add battery-storage device constants - gladys-zendure external Jul 22, 2026
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