Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9db7a71
test: drive a real MQTT frame to real entity state end to end
ngoviet Sep 12, 2026
3e06df7
feat: fetch a day's statistics in one request via getAllDayData
ngoviet Sep 12, 2026
fb0a463
docs: close the getErrorLog question with a measured answer
ngoviet Sep 12, 2026
04e4962
docs: record getAllDayData as the primary daily path
ngoviet Sep 12, 2026
99de25c
docs: record the traps this repo sets, and what was measured about each
ngoviet Sep 12, 2026
8363236
no-mistakes(review): Fix daily-stats fallback gate and stale doc poin…
ngoviet Sep 12, 2026
df173d8
no-mistakes(review): Scope overstated doc claim, drop dead test helpe…
ngoviet Sep 12, 2026
b3fd678
no-mistakes(review): Scope overstated doc claims, pin online-status a…
ngoviet Sep 12, 2026
6e024f7
no-mistakes(review): Scope fixture comment to totals actually capture…
ngoviet Sep 12, 2026
b3b1557
no-mistakes(review): Scope totals-test docstring: battery values unve…
ngoviet Sep 12, 2026
aa0f199
no-mistakes(review): Rename and reword e2e frame claims from captured…
ngoviet Sep 12, 2026
315504e
no-mistakes(review): Scope endpoint-equivalence claims, note backfill…
ngoviet Sep 12, 2026
415c766
no-mistakes(review): Record admin probe as out-of-policy, de-localize…
ngoviet Sep 13, 2026
bafee9c
no-mistakes(review): Sign battery series by 5-minute slot, not array …
ngoviet Sep 13, 2026
b67cfeb
no-mistakes(review): Refresh documented test counts after the series fix
ngoviet Sep 13, 2026
6140b11
no-mistakes(review): fold day series by slot, not by array index
ngoviet Sep 13, 2026
ccd9490
no-mistakes(review): keep both battery hour rollups on a one-sided day
ngoviet Sep 13, 2026
6437167
no-mistakes(review): remember a missing combined endpoint instead of …
ngoviet Sep 13, 2026
d5cc65b
no-mistakes(review): reject non-finite vendor numbers and close the b…
ngoviet Sep 13, 2026
ed4a60e
no-mistakes(review): catch OverflowError and pin the battery series s…
ngoviet Sep 13, 2026
af26608
no-mistakes(review): fill a series hole so its index stays its slot
ngoviet Sep 13, 2026
2ab7af7
no-mistakes(review): record the partial combined payload residual
ngoviet Sep 13, 2026
688cf08
no-mistakes(document): Repoint dangling survey anchor, reword stale l…
ngoviet Sep 13, 2026
7f9313e
no-mistakes(lint): annotate the transport-error responses dict for mypy
ngoviet Sep 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@

PLATFORMS: list[Platform] = [Platform.SENSOR, Platform.BINARY_SENSOR]

# Delay before the monthly/yearly/total coordinators are warmed, so the backfill
# that the daily coordinator kicks off has time to fill the cache they read.
# Module-level so a test can shrink it; ten real seconds per entry otherwise
# dominates the end-to-end suite.
_STAGGER_DELAY_SECONDS = 10.0


async def async_setup(hass: HomeAssistant, config: dict) -> bool:
"""Set up the Lumentree integration."""
Expand Down Expand Up @@ -122,7 +128,7 @@ async def _prime_coordinators_staggered():
except Exception as e:
_LOGGER.warning("Daily coordinator first refresh failed: %s", e)
# Give backfill time to populate cache, then refresh stats coordinators
await asyncio.sleep(10)
await asyncio.sleep(_STAGGER_DELAY_SECONDS)
for coord, label in (
(monthly_coord, "monthly"),
(yearly_coord, "yearly"),
Expand Down
5 changes: 5 additions & 0 deletions const.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ def get_timezone(hass: HomeAssistant):
URL_GET_BAT_DAY_DATA: Final = "/lesvr/getBatDayData"
URL_GET_YEAR_DATA: Final = "/lesvr/getYearData"
URL_GET_MONTH_DATA: Final = "/lesvr/getMonthData"
# Single-call replacement for the three per-metric day endpoints above.
# Note the absence of a "v2/" prefix: the APK contains "lesvr/v2/getAllDayData"
# because app 3.2.4 targets a different host (lesvrjm.suntcn.com), but against
# lesvr.suntcn.com the v2 path returns 998 (does not exist) and this one works.
URL_GET_ALL_DAY_DATA: Final = "/lesvr/getAllDayData"

DEFAULT_HEADERS: Final = {
"versionCode": "1.6.3",
Expand Down
Loading
Loading