code cleanup#1264
Merged
Merged
Conversation
Comment and docstring sweep plus two small refactors: - Strip narrations, historical PR/version references, and obvious code restatements across providers and the domain layer. - Where comments documented invariants (e.g. ``_tagged_once`` in akuvox and schlage), tighten rather than delete. - ts/generate-view.ts: extract ``wrapAsFoldOrSection`` helper to dedupe the fold-vs-section wrapper used by ``maybeGenerateFoldEntityRowCard`` and ``maybeGenerateFoldEntityRowConditionCard``. - ts/slot-card.ts: add ``HassElement`` and ``CardHelpers`` interfaces and extend the existing ``Window`` global; drop 3 ``as any`` casts plus two inline cast forms, removing the matching ``eslint-disable`` ``no-explicit-any`` directives. No behavior changes. Bundle regenerated by pre-commit yarn-build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: c61cef7455e6
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1264 +/- ##
=======================================
Coverage 97.15% 97.15%
=======================================
Files 54 54
Lines 6538 6543 +5
Branches 461 460 -1
=======================================
+ Hits 6352 6357 +5
Misses 186 186
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Comment and docstring cleanup, plus two small TypeScript refactors. No
behavior changes.
Comment / docstring sweep
previously,no longer,the old bool,PR #...,3.x,the previous behavior) and rewriteto describe the current invariant instead.
added no information beyond the code they preceded.
_tagged_onceinakuvoxandschlage(lifecycle of the auto-tag guard flag) —restore a tightened one-paragraph version rather than delete.
TypeScript
ts/generate-view.ts: extractwrapAsFoldOrSectionhelper somaybeGenerateFoldEntityRowCardandmaybeGenerateFoldEntityRowConditionCardeach end in a singlereturn wrapAsFoldOrSection(...)call.ts/slot-card.ts: addHassElementandCardHelpersinterfacesand extend the existing
declare global { interface Window }blockwith
loadCardHelpers. Drops 3as anycasts plus two inline castforms and the matching
eslint-disable-next-line@typescript-eslint/no-explicit-anydirectives.Type of change
Test plan
-32lines across the Python / TS sources; the bundleregeneration adds a comparable amount of generated output.
🤖 Generated with Claude Code