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

20240710.0 #21350

Merged
merged 15 commits into from
Jul 10, 2024
Merged

20240710.0 #21350

merged 15 commits into from
Jul 10, 2024

Conversation

piitaya
Copy link
Member

@piitaya piitaya commented Jul 10, 2024

Summary by CodeRabbit

  • New Features

    • Added a climate.auto_defrosting entity with "defrosting" hvac action.
    • Introduced new HVAC actions and corresponding modes in climate control systems.
    • Added new TURN_OFF and TURN_ON features to the FanEntityFeature.
    • Enhanced localization in several components with new localize functions.
  • Enhancements

    • Improved property handling within HuiCard and HuiEntityCard classes.
    • Added new icons for "defrosting" state.
    • Added localization keys for "Horizontal stack" and "Vertical stack".
  • Dependency Updates

    • Updated several npm dependencies to their latest versions.
    • Bumped home-assistant-frontend version in pyproject.toml.
  • Style

    • Removed styling rules for disabled states within several ha-selector components.

Copy link
Contributor

coderabbitai bot commented Jul 10, 2024

Walkthrough

Walkthrough

The recent changes encompass version updates for actions/upload-artifact in CI/CD workflows, dependency upgrades in package.json, minor enhancements to climate and entity states, new styling adaptations, the addition of localization features, and modifications to Lovelace card editors. The overall aim is to improve maintenance, localization, and user interface consistency within the system.

Changes

File(s) Change Summary
.github/workflows/ci.yaml, .github/workflows/nightly.yaml Updated the version of actions/upload-artifact from v4.3.3 to v4.3.4.
gallery/src/pages/misc/entity-state.ts Added entity climate.auto_defrosting with hvac_action: "defrosting" to the ENTITIES array.
package.json Incremented versions for several dependencies, including @braintree/sanitize-url, @codemirror/autocomplete, @vaadin/combo-box, marked, etc.
pyproject.toml Updated the project version from 20240705.0 to 20240710.0.
src/common/entity/get_states.ts Added defrosting state to FIXED_DOMAIN_ATTRIBUTE_STATES.
src/components/data-table/dialog-data-table-settings.ts Introduced a localize function to localize string values.
src/components/data-table/show-dialog-data-table-settings.ts Added localizeFunc property to DataTableSettingsDialogParams.
src/components/ha-selector/ha-selector-action.ts, ha-selector-condition.ts, ha-selector-trigger.ts Removed styling for disabled attribute affecting opacity and pointer events.
src/data/climate.ts Adjusted HvacAction type by adding defrosting, drying, fan; removed preheating; updated CLIMATE_HVAC_ACTION_TO_MODE mappings.
src/data/fan.ts Added TURN_OFF and TURN_ON features to the FanEntityFeature enum.
src/fake_data/entity_component_icons.ts Added icon reference for "defrosting" state.
src/layouts/hass-tabs-subpage-data-table.ts Added localizeFunc property to the object in setProperties().
src/panels/lovelace/cards/hui-card.ts Changed @property for preview from { attribute: false } to { type: Boolean }.
src/panels/lovelace/cards/hui-entity-card.ts Updated fixedFooter condition logic to require "grid" layout and _footerElement.
src/panels/lovelace/editor/config-elements/hui-grid-card-editor.ts Modified imports and methods, changing _computeLabelCallback from private to protected.
src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts Added new methods and properties to the class, like formData() and _valueChanged.
src/translations/en.json Added title attributes for "Horizontal stack" and "Vertical stack" entities.

Sequence Diagram(s)

The changes are primarily composed of version updates, minor enhancements, and styling adjustments which do not significantly alter control flows or introduce new feature interactions, so no sequence diagrams are required.


Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 895333a and 7edc4ef.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (20)
  • .github/workflows/ci.yaml (2 hunks)
  • .github/workflows/nightly.yaml (1 hunks)
  • gallery/src/pages/misc/entity-state.ts (1 hunks)
  • package.json (4 hunks)
  • pyproject.toml (1 hunks)
  • src/common/entity/get_states.ts (1 hunks)
  • src/components/data-table/dialog-data-table-settings.ts (3 hunks)
  • src/components/data-table/show-dialog-data-table-settings.ts (2 hunks)
  • src/components/ha-selector/ha-selector-action.ts (1 hunks)
  • src/components/ha-selector/ha-selector-condition.ts (1 hunks)
  • src/components/ha-selector/ha-selector-trigger.ts (1 hunks)
  • src/data/climate.ts (2 hunks)
  • src/data/fan.ts (1 hunks)
  • src/fake_data/entity_component_icons.ts (1 hunks)
  • src/layouts/hass-tabs-subpage-data-table.ts (1 hunks)
  • src/panels/lovelace/cards/hui-card.ts (1 hunks)
  • src/panels/lovelace/cards/hui-entity-card.ts (1 hunks)
  • src/panels/lovelace/editor/config-elements/hui-grid-card-editor.ts (3 hunks)
  • src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts (6 hunks)
  • src/translations/en.json (2 hunks)
Additional context used
Biome
src/panels/lovelace/editor/config-elements/hui-grid-card-editor.ts

[error] 65-65: Forbidden non-null assertion.

Unsafe fix: Replace with optional chain operator ?. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator

(lint/style/noNonNullAssertion)

src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts

[error] 100-100: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 317-317: Forbidden non-null assertion.

Unsafe fix: Replace with optional chain operator ?. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator

(lint/style/noNonNullAssertion)


[error] 318-318: Forbidden non-null assertion.

Unsafe fix: Replace with optional chain operator ?. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator

(lint/style/noNonNullAssertion)

Additional comments not posted (35)
pyproject.toml (1)

7-7: Version bump approved.

The version update from "20240705.0" to "20240710.0" is straightforward and non-impactful.

src/components/data-table/show-dialog-data-table-settings.ts (1)

2-2: Addition of localization function.

The addition of the localizeFunc property enhances flexibility by allowing a custom localization function.

src/components/ha-selector/ha-selector-action.ts (1)

Line range hint 1-44: Removal of disabled state styles.

The removal of styling rules for the disabled state should be verified to ensure it does not negatively impact functionality or appearance.

src/components/ha-selector/ha-selector-trigger.ts (1)

Line range hint 1-44: Removal of disabled state styles.

The removal of styling rules for the disabled state should be verified to ensure it does not negatively impact functionality or appearance.

.github/workflows/nightly.yaml (1)

60-60: Verify the impact of the updated action version.

The actions/upload-artifact version has been updated from v4.3.3 to v4.3.4. Ensure that the new version does not introduce breaking changes.

Also applies to: 67-67

src/panels/lovelace/editor/config-elements/hui-grid-card-editor.ts (3)

13-16: Imports look good!

The new imports for HaFormSchema and SchemaUnion are correctly added.


Line range hint 26-39:
SCHEMA constant looks good!

The SCHEMA constant is well-defined with appropriate types and default values.


53-62: Review the setConfig and formData methods.

The new _schema property and setConfig method look correct. The assert function is used to validate the config against the cardConfigStruct.

The formData method correctly merges square: true with the existing configuration.

src/data/climate.ts (2)

32-38: Review new HvacAction values.

The new HvacAction values "defrosting", "drying", and "fan" are correctly added. Ensure these new values are consistent with the rest of the codebase and documentation.


93-99: Review updated CLIMATE_HVAC_ACTION_TO_MODE mappings.

The updated mappings in CLIMATE_HVAC_ACTION_TO_MODE appear correct. Each HvacAction is mapped appropriately to an HvacMode. Ensure these mappings are used correctly in the rest of the codebase.

src/data/fan.ts (1)

20-21: LGTM! Added enum values are correct.

The new TURN_OFF and TURN_ON enum values are correct and align well with typical fan operations.

.github/workflows/ci.yaml (2)

92-92: LGTM! Version update for actions/upload-artifact.

The version update from v4.3.3 to v4.3.4 is approved.


116-116: LGTM! Version update for actions/upload-artifact.

The version update from v4.3.3 to v4.3.4 in the supervisor job is approved.

src/panels/lovelace/cards/hui-card.ts (1)

26-26: LGTM! Property type change for preview is correct.

Changing the preview property to explicitly specify { type: Boolean } aligns with best practices.

src/common/entity/get_states.ts (1)

128-128: LGTM! Added state defrosting is correct.

The new state "defrosting" is correctly added to the hvac_action list.

src/components/data-table/dialog-data-table-settings.ts (3)

81-82: Localization function assignment looks good.

The addition of the localize function assignment ensures flexibility in localization.


95-95: Updated localization usage is correct.

The localize function usage correctly replaces the previous localization method for the dialog header.


151-154: Localization function usage looks consistent.

The localize function usage for button labels ensures consistency in localization.

package.json (7)

29-29: Dependency update for @braintree/sanitize-url looks good.

The update from 7.0.3 to 7.0.4 is a minor version bump and should be backward compatible.


30-30: Dependency update for @codemirror/autocomplete looks good.

The update from 6.16.3 to 6.17.0 is a minor version bump and should be backward compatible.


36-36: Dependency update for @codemirror/view looks good.

The update from 6.28.3 to 6.28.4 is a minor version bump and should be backward compatible.


91-91: Dependency update for @vaadin/combo-box looks good.

The update from 24.4.0 to 24.4.1 is a minor version bump and should be backward compatible.


92-92: Dependency update for @vaadin/vaadin-themable-mixin looks good.

The update from 24.4.0 to 24.4.1 is a minor version bump and should be backward compatible.


208-208: Dependency update for glob looks good.

The update from 10.4.2 to 10.4.3 is a minor version bump and should be backward compatible.


121-121: Verify the major version bump for marked.

The update from 12.0.2 to 13.0.2 includes a major version bump. Verify for potential breaking changes.

src/panels/lovelace/cards/hui-entity-card.ts (1)

139-139: Modified condition for fixedFooter looks good.

The logic modification ensures that fixedFooter is only true when both conditions are met, enhancing the correctness.

src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts (4)

53-59: Schema addition looks good.

The added schema constant SCHEMA is correctly defined and follows the standard structure for form schemas.


85-86: Property assignment for _schema looks good.

The addition correctly assigns the schema to the _schema property, ensuring its usage within the class.


99-102: Method addition formData looks good.

The formData method correctly returns the class configuration, essential for form data handling.

Tools
Biome

[error] 100-100: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


312-315: Method addition _valueChanged looks good.

The _valueChanged method ensures that configuration changes are correctly propagated by firing a config-changed event.

gallery/src/pages/misc/entity-state.ts (1)

143-145: Add localization and relevant attributes for new climate state.

The new 'defrosting' state should be localized and properly integrated with the system.

+  createEntity("climate.auto_defrosting", "auto", undefined, {
+    hvac_action: "defrosting",
+  }),

[approve]
The code addition looks correct and follows the existing pattern.

src/fake_data/entity_component_icons.ts (1)

910-912: Ensure consistency across new state icons

The added icon reference for "defrosting" state should be consistent with other existing state icons.

+            defrosting: "mdi:snowflake-melt",

[approve]
The icon mapping for the new "defrosting" state is correct and consistent with existing patterns.

src/layouts/hass-tabs-subpage-data-table.ts (1)

Line range hint 47-47: Property addition: Verify the usage and purpose of localizeFunc.

Ensure that the newly added localizeFunc property is correctly used and initialized.

+  @property({ attribute: false }) public localizeFunc?: LocalizeFunc;

[approve]
The addition of the localizeFunc property looks good and aligns with the rest of the property declarations.

src/translations/en.json (2)

5855-5855: Translation key addition looks correct.

The title key has been added with the correct translation key reference.


5992-5992: Translation key addition looks correct.

The title key has been added with the correct translation key reference.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added GitHub Actions Pull requests that update GitHub Actions code Demo Related to frontend demo content Design Related to Home Assistant design gallery labels Jul 10, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

@piitaya piitaya merged commit 0447247 into master Jul 10, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Demo Related to frontend demo content Design Related to Home Assistant design gallery GitHub Actions Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants