v1.3.3
HA Daily Counter v1.3.3 — 2025-11-07
Summary
Bug fixes and improvements to the configuration flow, type-stub/mypy compatibility fixes, and better compatibility with recent Home Assistant releases. Adds a single global logic selector (AND / OR) used to combine multiple triggers created during setup.
Added
- Add a logic selector (AND / OR) in the first step of the configuration flow. This value is stored in the config entry as
logicand is applied to all triggers added afterward.- Default logic:
OR.
- Default logic:
Changed
- Configuration flow behavior:
- If the "add_another" checkbox is NOT checked at any step, the flow now ends immediately and a config entry is created with the collected triggers.
- If "add_another" is checked, the flow enters a repeatable step to add more sensors until the user unchecks the box.
- The logic selector is shown only in the initial form (after the checkbox) and is not shown in the repeatable "add trigger" forms.
- Additional-triggers UI:
- For repeatable trigger-adding steps the implementation now uses a Select dropdown built from filtered entity IDs rather than attempting to pass a dynamic "options" list into
EntitySelectorConfig. - Rationale: this keeps the runtime behavior while maintaining static typing compatibility with homeassistant stubs (avoids a TypedDict error).
- For repeatable trigger-adding steps the implementation now uses a Select dropdown built from filtered entity IDs rather than attempting to pass a dynamic "options" list into
- Stored config entry data shape:
data["triggers"]now contains a list of trigger objects:{ "id": "<uuid>", "entity": "<entity_id>", "state": "<state>" }data["logic"]contains the selected logic operator:"AND"or"OR".
Fixed
- Fixed a bug where the flow did not finish and create the entry when the "add_another" box was not checked.
- Fixed multiple mypy/type-checking errors in CI:
- Removed unsupported
translation_keyarguments fromasync_show_formcalls (stubs). - Use
SelectSelectorMode.DROPDOWNinstead of bare strings for selectormode. - Avoid passing unsupported
optionskey toEntitySelectorConfig(useSelectSelectorfor dynamic lists instead). - Fixed typing around
hass.config_entries.async_forward_entry_setups/async_forward_entry_unloadsby locally casting toAnyto preserve compatibility across Home Assistant versions and avoid stub errors. - Removed unnecessary
type: ignorecomments flagged by mypy.
- Removed unsupported
Compatibility / Migration notes
- New config entries created with v1.3.3 include the
logicfield. If you have existing config entries created by earlier versions:- Integrations or code expecting
logicshould treat missinglogicasORby default. - No automatic migration tool is included in this release; if you want to backfill existing entries, update them manually or run a small migration script that sets
logic: "OR"for entries missing the field.
- Integrations or code expecting
- UI difference in repeatable trigger step:
- The repeatable step uses a dropdown (SelectSelector) of entity_ids filtered to the domain of the first selected entity and excluding already-chosen entities.
- If you prefer the EntitySelector-style autocomplete/picker for that step, it can be restored but will require either a small mypy suppression or a change to the stubs; the current approach prioritizes CI/type-safety.
Developer notes
- The following changes were made to resolve mypy issues:
- Remove
translation_keyparameter usage from calls toasync_show_form. - Use
SelectSelectorMode.DROPDOWN(enum) instead of strings. - Replace invalid
EntitySelectorConfig(options=...)usage with aSelectSelectorconstructed fromSelectOptionDictentries. - Use
cast(Any, hass.config_entries)around forward/unload entry calls to avoid typing errors with different HA versions.
- Remove
- Tests / CI:
- After applying the changes, run the pipeline locally or in CI:
- pip install mypy==1.10.0
- mypy --config-file mypy.ini
- Confirm no mypy errors remain.
- After applying the changes, run the pipeline locally or in CI:
Notes for users
- How to test the new flow:
- Install or update the custom component files and restart Home Assistant.
- Go to Settings → Integrations → Add integration → HA Daily Counter.
- Step 1 (Initial): enter Name, select first entity, select state, choose whether to Add another, and choose the logic (AND/OR, default OR).
- If you do not check "Add another", the flow should finish and create the entry immediately.
- If you check "Add another", you will see repeated forms that let you pick additional entities (filtered by domain), select state, and optionally add more.
- After finishing, review the created config entry: it will include the
triggerslist and the chosenlogic.
- Default behavior: if
logicis missing for any older config entry, treat it asOR.
Security
- No security-sensitive changes in this release.
Credits
- Changes and fixes by Geek-MD and contributors.