Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] Entity Optimization - Chores #94

Open
1 task
ccpk1 opened this issue Feb 25, 2025 · 2 comments
Open
1 task

[REQ] Entity Optimization - Chores #94

ccpk1 opened this issue Feb 25, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request solved. implemented for next release A fix is already prepared and will be included on the next release

Comments

@ccpk1
Copy link
Collaborator

ccpk1 commented Feb 25, 2025

Is your feature request related to a problem?

  • Yes

Please describe the problem

Now that I’ve built out the majority of features in the dashboard, I wanted to take a step back and evaluate which entities are actively contributing value versus those that may be redundant or underutilized. This aligns with my previous request regarding badge entities and extends the idea to a broader entity review.

The goal is to streamline entity usage and upkeep while maintaining flexibility for those who need specific details.

Describe the solution you'd like

I’d like to propose consolidating four chore-related sensors into a single status sensor to reduce entity count while maintaining functionality. The affected sensors are:

  1. sensor.kc_jiri_simon_chore_approvals_vynest_kos
  2. sensor.kc_jiri_simon_chore_claims_vynest_kos
  3. sensor.kc_jiri_simon_chore_status_vynest_kos
  4. sensor.kc_jiri_simon_chore_streak_vynest_kos

Proposal

  • Merge the approvals, claims, and streak into the existing status sensor by adding attributes for pending approvals, claims, and streak count.
  • Implement this change over 2-3 releases to allow users time to adjust.
  • Mark the old sensors with a deprecated attribute, e.g., Deprecating April 2nd, before removal.

Expected Impact

  • For an average setup (e.g., 2 kids × 10 chores), this would eliminate 60 unnecessary entities, simplifying maintenance and improving performance.

Image

Let me know if this is something you want to consider.

Describe alternatives you've considered

No response

Additional context

No response

@ccpk1 ccpk1 added the enhancement New feature or request label Feb 25, 2025
@ad-ha ad-ha self-assigned this Feb 25, 2025
@ad-ha ad-ha added the developing Included on the roadmap fand being developed for future releases label Feb 25, 2025
@ad-ha
Copy link
Owner

ad-ha commented Feb 26, 2025

Well, thinking out loud, if we do this we can also get rid of the Streak Sensors, as those are also included already on the ChoreStatusSensor:

        attributes = {
            ATTR_KID_NAME: self._kid_name,
            ATTR_CHORE_NAME: self._chore_name,
            ATTR_DESCRIPTION: chore_info.get("description", ""),
            ATTR_CHORE_CLAIMS_COUNT: kid_info.get("chore_claims", {}).get(
                self._chore_id, 0
            ),
            ATTR_CHORE_APPROVALS_COUNT: kid_info.get("chore_approvals", {}).get(
                self._chore_id, 0
            ),
            ATTR_CHORE_CURRENT_STREAK: current_streak,
            ATTR_CHORE_HIGHEST_STREAK: highest_streak,
            ATTR_SHARED_CHORE: shared,
            ATTR_GLOBAL_STATE: global_state,
            ATTR_RECURRING_FREQUENCY: chore_info.get("recurring_frequency", "None"),
            ATTR_APPLICABLE_DAYS: chore_info.get("applicable_days", []),
            ATTR_DUE_DATE: chore_info.get("due_date", DUE_DATE_NOT_SET),
            ATTR_DEFAULT_POINTS: chore_info.get("default_points", 0),
            ATTR_PARTIAL_ALLOWED: chore_info.get("partial_allowed", False),
            ATTR_ALLOW_MULTIPLE_CLAIMS_PER_DAY: chore_info.get(
                "allow_multiple_claims_per_day", False
            ),
            ATTR_ASSIGNED_KIDS: assigned_kids_names,
            ATTR_LABELS: friendly_labels,
        }

        if chore_info.get("recurring_frequency") == FREQUENCY_CUSTOM:
            attributes[ATTR_CUSTOM_FREQUENCY_INTERVAL] = chore_info.get(
                "custom_interval"
            )
            attributes[ATTR_CUSTOM_FREQUENCY_UNIT] = chore_info.get(
                "custom_interval_unit"
            )

@ad-ha ad-ha added solved. implemented for next release A fix is already prepared and will be included on the next release and removed developing Included on the roadmap fand being developed for future releases labels Feb 26, 2025
@ccpk1
Copy link
Collaborator Author

ccpk1 commented Feb 26, 2025

I agree, I had them in my count above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request solved. implemented for next release A fix is already prepared and will be included on the next release
Projects
None yet
Development

No branches or pull requests

2 participants