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

Migrate base automation config to plurals #22053

Merged
merged 5 commits into from
Sep 24, 2024
Merged

Conversation

bramkragten
Copy link
Member

@bramkragten bramkragten commented Sep 22, 2024

Proposed change

Adds support and migrates automation config to use plurals for triggers, conditions and actions.

Needs: home-assistant/core#123823

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Summary by CodeRabbit

  • New Features

    • Updated automation configuration structure to support multiple triggers, conditions, and actions.
    • Introduced a migration function to facilitate the transition from the old configuration format to the new one.
  • Bug Fixes

    • Enhanced validation processes to ensure compatibility with the new configuration structure.
    • Improved handling of automation configurations in the editor.
  • Documentation

    • Updated terminology in the automation editor to reflect the new pluralized property names.

Copy link
Contributor

coderabbitai bot commented Sep 22, 2024

Warning

Rate limit exceeded

@bramkragten has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 56 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 2b11f2f and 35c3624.

Walkthrough

Walkthrough

The changes across multiple files involve a consistent update to the naming conventions of properties related to automation configurations. The singular properties trigger, condition, and action have been replaced with their plural counterparts: triggers, conditions, and actions. This adjustment is reflected in various components, interfaces, and methods, ensuring that the new structure accommodates multiple entries for each category. Additionally, a migration function has been introduced to facilitate the transition from the old configuration format to the new one, ensuring compatibility within the system.

Changes

Files Change Summary
src/components/trace/hat-script-graph.ts Updated property names in this.trace.config from trigger, condition, and action to triggers, conditions, and actions.
src/data/automation.ts Modified ManualAutomationConfig interface to replace singular properties with plural ones, added migrateAutomationConfig function for configuration migration.
src/data/config.ts Updated ValidKeys type definition to reflect plural property names: triggers, actions, and conditions.
src/panels/config/automation/ha-automation-editor.ts Changed validation and assignment logic to use plural property names, added a call to migrateAutomationConfig for configuration processing.
src/panels/config/automation/manual-automation-editor.ts Renamed properties in this.config from singular to plural forms, ensuring consistency across event handling and default values.
gallery/src/data/traces/basic_trace.ts Renamed keys in the basicTrace object from trigger, condition, and action to triggers, conditions, and actions.
gallery/src/data/traces/mock-demo-trace.ts Updated config object properties from trigger and action to triggers and actions.
gallery/src/data/traces/motion-light-trace.ts Renamed keys in the motionLightTrace configuration from trigger to triggers and action to actions.
gallery/src/pages/automation/describe-action.ts Changed property name from service to action in the initialAction object.
src/data/script.ts Modified getActionType function to check for both action and service properties in the action object.
src/data/trace.ts Updated getDataFromPath function to handle plural properties triggers, conditions, and actions when retrieving data.

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>, please review it.
    -- 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3478bd3 and 22f0392.

Files selected for processing (5)
  • src/components/trace/hat-script-graph.ts (2 hunks)
  • src/data/automation.ts (2 hunks)
  • src/data/config.ts (1 hunks)
  • src/panels/config/automation/ha-automation-editor.ts (3 hunks)
  • src/panels/config/automation/manual-automation-editor.ts (7 hunks)
Additional context used
Biome
src/data/automation.ts

[error] 398-398: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 404-404: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 410-410: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

Additional comments not posted (17)
src/data/config.ts (1)

13-13: LGTM! The type definition change aligns with the PR objective.

The update to the ValidKeys type definition from singular to plural keys is consistent with the PR objective of migrating to a plural-based configuration system for automation in Home Assistant. This change suggests that the configuration will now support multiple triggers, actions, and conditions.

As mentioned in the AI-generated summary, ensure that:

  1. The code that uses the ValidKeys type is updated to align with the new structure.
  2. The migration function is implemented correctly to facilitate the transition from the old configuration format to the new one.
src/panels/config/automation/manual-automation-editor.ts (4)

92-92: LGTM!

The change from trigger to triggers is consistent with the overall migration to plural property names. Looks good!


122-122: LGTM!

The change from condition to conditions is consistent with the overall migration to plural property names. Looks good!


134-134: LGTM!

The change from condition to conditions is consistent with the overall migration to plural property names. Looks good!


163-163: LGTM!

The changes from action to actions, trigger to triggers, and condition to conditions are consistent with the overall migration to plural property names. Looks good across all these instances!

Also applies to: 174-174, 188-188, 197-197, 205-205

src/components/trace/hat-script-graph.ts (5)

575-577: LGTM!

The changes to use the triggers property and pass it to flattenTriggers are correct and consistent with the migration to plural property names.


588-590: LGTM!

The changes to use the conditions property and pass it to ensureArray are correct and consistent with the migration to plural property names.


593-595: LGTM!

The changes to use the actions property and pass it to ensureArray are correct and consistent with the migration to plural property names.


575-577: This code segment was already reviewed earlier.


588-590: This code segment was already reviewed earlier.

src/data/automation.ts (4)

30-38: Good use of deprecation for backward compatibility

The migration to plural property names (triggers, conditions, actions) while keeping the singular versions (trigger, condition, action) as deprecated ensures backward compatibility. This allows existing configurations to continue functioning while encouraging users to adopt the new plural properties.


371-372: Integrate migration into normalization process

Including the migrateAutomationConfig(config) call within normalizeAutomationConfig ensures that configurations using deprecated singular properties are properly converted to the new plural properties before normalization.


375-378: Update normalization to handle plural properties

Updating the loop to iterate over the plural keys ["triggers", "conditions", "actions"] ensures that these properties are correctly normalized as arrays, maintaining consistency in the configuration format.


382-383: Migrate actions using plural property

The check and migration for config.actions now correctly uses the plural form, aligning with the updated property naming convention.

src/panels/config/automation/ha-automation-editor.ts (3)

49-49: Importing migrateAutomationConfig

Importing migrateAutomationConfig ensures that the migration functionality is available for use.


524-526: Updating property names to plural form in validateConfig

Changing trigger, condition, and action to triggers, conditions, and actions aligns with the new plural-based configuration structure.


641-644: Applying migration to YAML editor changes

Processing the YAML editor value with migrateAutomationConfig before updating _config ensures that any legacy configurations are properly migrated to the new format.

Comment on lines +389 to +413
export const migrateAutomationConfig = <
T extends Partial<AutomationConfig> | AutomationConfig,
>(
config: T
) => {
if ("trigger" in config) {
if (!("triggers" in config)) {
config.triggers = config.trigger;
}
delete config.trigger;
}
if ("condition" in config) {
if (!("conditions" in config)) {
config.conditions = config.condition;
}
delete config.condition;
}
if ("action" in config) {
if (!("actions" in config)) {
config.actions = config.action;
}
delete config.action;
}
return config;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using the delete operator to improve performance

Using the delete operator on objects can degrade performance because it alters the object's shape, leading to deoptimizations in JavaScript engines. Consider setting the properties to undefined instead, or refactoring the code to avoid removing properties.

Apply this diff to replace delete operations with assignments to undefined:

      if ("trigger" in config) {
        if (!("triggers" in config)) {
          config.triggers = config.trigger;
        }
-       delete config.trigger;
+       config.trigger = undefined;
      }
      if ("condition" in config) {
        if (!("conditions" in config)) {
          config.conditions = config.condition;
        }
-       delete config.condition;
+       config.condition = undefined;
      }
      if ("action" in config) {
        if (!("actions" in config)) {
          config.actions = config.action;
        }
-       delete config.action;
+       config.action = undefined;
      }

Alternatively, consider restructuring the code to avoid the need to remove properties, such as creating a new object to store the migrated configuration.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const migrateAutomationConfig = <
T extends Partial<AutomationConfig> | AutomationConfig,
>(
config: T
) => {
if ("trigger" in config) {
if (!("triggers" in config)) {
config.triggers = config.trigger;
}
delete config.trigger;
}
if ("condition" in config) {
if (!("conditions" in config)) {
config.conditions = config.condition;
}
delete config.condition;
}
if ("action" in config) {
if (!("actions" in config)) {
config.actions = config.action;
}
delete config.action;
}
return config;
};
export const migrateAutomationConfig = <
T extends Partial<AutomationConfig> | AutomationConfig,
>(
config: T
) => {
if ("trigger" in config) {
if (!("triggers" in config)) {
config.triggers = config.trigger;
}
config.trigger = undefined;
}
if ("condition" in config) {
if (!("conditions" in config)) {
config.conditions = config.condition;
}
config.condition = undefined;
}
if ("action" in config) {
if (!("actions" in config)) {
config.actions = config.action;
}
config.action = undefined;
}
return config;
};
Tools
Biome

[error] 398-398: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 404-404: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 410-410: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

@github-actions github-actions bot added the Design Related to Home Assistant design gallery label Sep 24, 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: 0

Outside diff range and nitpick comments (5)
src/data/trace.ts (1)

190-204: LGTM! Consider a minor refactoring for improved readability.

The changes successfully implement the migration to plural forms for triggers, conditions, and actions while maintaining backward compatibility. This aligns well with the PR objectives.

Consider refactoring the repeated checks into a more concise form:

const pluralMap = {
  trigger: "triggers",
  condition: "conditions",
  action: "actions"
};

let tempResult = result[raw];
if (!tempResult && raw in pluralMap) {
  tempResult = result[pluralMap[raw as keyof typeof pluralMap]];
}

This refactoring would make the code more maintainable and easier to extend in the future if needed.

gallery/src/data/traces/motion-light-trace.ts (2)

136-143: LGTM! Consider adding a comment for clarity.

The change from trigger to triggers aligns with the PR objective of migrating to plurals for automation config. This change improves flexibility by allowing multiple triggers.

Consider adding a comment to explain the purpose of this change, especially if it's part of a larger migration effort. For example:

// Migrated to plural 'triggers' to support multiple trigger configurations
triggers: [
  // ... existing configuration ...
],

Line range hint 144-170: LGTM! Consider adding a comment for consistency.

The change from action to actions aligns with the PR objective and maintains the existing functionality of supporting multiple actions.

For consistency with the triggers section, consider adding a similar comment here:

// Migrated to plural 'actions' to maintain support for multiple action configurations
actions: [
  // ... existing configurations ...
],
gallery/src/data/traces/basic_trace.ts (1)

Singular Keys Still Present in the Codebase

The verification revealed that singular forms (trigger, condition, action) are still being used in multiple files. Please update these occurrences to their plural counterparts (triggers, conditions, actions) to maintain consistency and prevent potential issues.

Key areas to address:

  • gallery/src/data/traces/basic_trace.ts
    • Lines referencing trigger, condition, and action within the trace sections.
  • src/panels/config/automation/ha-automation-editor.ts
    • References to basicTrace.config.trigger, basicTrace.config.condition, and basicTrace.config.action.
  • Various Selector and Action Components
    • Files such as ha-selector.ts, hui-action-editor.ts, and others still use singular keys.

Ensuring all parts of the codebase consistently use the plural forms will enhance flexibility and reduce the risk of errors.

Analysis chain

Line range hint 220-280: Consistent renaming to plural forms, but consider broader implications.

The changes from singular to plural forms (trigger to triggers, condition to conditions, and action to actions) in the config section are consistent with the PR objective. This modification enhances flexibility by allowing multiple entries for each category.

However, there are a few points to consider:

  1. Ensure that all code consuming this basicTrace object is updated to use the new plural keys.
  2. The trace section of the basicTrace object still uses singular forms (e.g., trigger/0, condition/0, action/0). Consider whether these should also be updated for consistency.
  3. The logbookEntries section might need updates if it relies on the structure of the config section.

To ensure consistency across the codebase, run the following script:

This script will help identify any inconsistencies or areas that might need further updates.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining singular forms and usages of the old structure

# Test 1: Check for remaining singular forms in TypeScript/JavaScript files
echo "Checking for remaining singular forms:"
rg --type ts --type js 'trigger:' -C 2
rg --type ts --type js 'condition:' -C 2
rg --type ts --type js 'action:' -C 2

# Test 2: Check for usages of the old structure
echo "Checking for usages of the old structure:"
rg --type ts --type js 'basicTrace\.config\.trigger' -C 2
rg --type ts --type js 'basicTrace\.config\.condition' -C 2
rg --type ts --type js 'basicTrace\.config\.action' -C 2

# Test 3: Check if trace section uses singular forms
echo "Checking trace section for singular forms:"
rg --type ts --type js '"trigger/\d+"' -C 2
rg --type ts --type js '"condition/\d+"' -C 2
rg --type ts --type js '"action/\d+"' -C 2

Length of output: 219866

src/data/script.ts (1)

407-407: LGTM! Consider adding a comment for clarity.

The change improves backward compatibility by allowing both "action" and "service" properties to identify a service action. This aligns well with the PR objective of migrating to a more flexible configuration system.

Consider adding a brief comment explaining the reason for checking both "action" and "service" properties. This would help future maintainers understand the rationale behind this change. For example:

-  if ("action" in action || "service" in action) {
+  // Check for both "action" and "service" to support both new and legacy configurations
+  if ("action" in action || "service" in action) {
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6c0815e and 2b11f2f.

Files selected for processing (7)
  • gallery/src/data/traces/basic_trace.ts (1 hunks)
  • gallery/src/data/traces/mock-demo-trace.ts (1 hunks)
  • gallery/src/data/traces/motion-light-trace.ts (1 hunks)
  • gallery/src/pages/automation/describe-action.ts (1 hunks)
  • src/components/trace/hat-script-graph.ts (2 hunks)
  • src/data/script.ts (1 hunks)
  • src/data/trace.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/components/trace/hat-script-graph.ts
Additional comments not posted (3)
gallery/src/data/traces/mock-demo-trace.ts (1)

34-35: LGTM! Verify usage of mock data in tests.

The changes from trigger to triggers and action to actions are consistent with the PR objectives of migrating to plurals for automation configuration. Initializing these as empty arrays is appropriate for the new structure.

To ensure consistency across the codebase, please verify that all tests and components using this mock data have been updated to expect arrays for triggers and actions. Run the following script to check for any remaining usage of the singular forms in test files:

If any results are returned, those test files may need to be updated to use the new plural forms.

gallery/src/pages/automation/describe-action.ts (1)

124-127: ⚠️ Potential issue

Ensure consistency with the new automation configuration structure

The change from service to action in the initialAction object is a step towards the new automation configuration structure. However, there are a few points to consider:

  1. The value "light.turn_on" might need to be updated to match the new action property format.
  2. This change creates an inconsistency with the rest of the file, particularly the ACTIONS array and describeAction function calls, which still use the old service format.

To maintain consistency and fully implement the new structure:

  1. Update the action value to match the new format (if different from the old service format).
  2. Review and update the ACTIONS array to use the new action property instead of service.
  3. Ensure that the describeAction function and its calls throughout the file support the new action property.
  4. Update any related tests or documentation to reflect this change.

To verify the usage of service and action properties in other files:

This will help identify other files that may need similar updates.

Verification successful

Consistency confirmed with the new automation configuration structure

All instances of the service property have been successfully replaced with action in gallery/src/pages/automation/describe-action.ts. The change aligns with the new automation configuration, and no inconsistent usages were found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for 'service' and 'action' properties in automation-related files
echo "Files using 'service' property:"
rg --type typescript --type javascript -g '!**/node_modules/**' '"service":' src/
echo "\nFiles using 'action' property:"
rg --type typescript --type javascript -g '!**/node_modules/**' '"action":' src/

Length of output: 396


Script:

#!/bin/bash
# Search for 'service' and 'action' properties in automation-related files
echo "Files using 'service' property:"
rg --type ts --type js -g '!**/node_modules/**' '"service":' src/
echo "\nFiles using 'action' property:"
rg --type ts --type js -g '!**/node_modules/**' '"action":' src/

Length of output: 294


Script:

#!/bin/bash
# Search for 'service' and 'action' properties in 'describe-action.ts'
echo "Occurrences of 'service' property in 'describe-action.ts':"
rg '"service":' gallery/src/pages/automation/describe-action.ts
echo "\nOccurrences of 'action' property in 'describe-action.ts':"
rg '"action":' gallery/src/pages/automation/describe-action.ts

Length of output: 410

gallery/src/data/traces/motion-light-trace.ts (1)

Line range hint 136-170: Verify impact on dependent code and documentation.

The changes to triggers and actions improve the configuration structure and align with the PR objectives. However, it's important to ensure that these changes are properly handled in any code that consumes this data structure.

Please run the following script to identify potential areas that might need updates:

This script will help identify areas that might need attention due to these changes.

Verification successful

Corrected Script for Comprehensive Verification

The previous script failed to identify TypeScript files due to incorrect file type specifications. Please run the updated script below to accurately search for usages of motionLightTrace, trigger, and action within TypeScript files and related documentation.

This corrected script uses the appropriate rg file types (ts and tsx) to ensure all relevant TypeScript files are scanned. Executing this will help identify any dependent code or documentation that requires updates based on the recent changes.


Updated Script to Accurately Search TypeScript Files

The previous script failed to recognize .tsx files due to incorrect type specifications. Please use the updated script below, which correctly specifies typescript and typescriptreact as the file types. This will ensure that all relevant TypeScript files are searched for motionLightTrace, trigger, and action.

This updated script correctly identifies TypeScript and TypeScript React files, ensuring a thorough search across the codebase. Please execute this script to gather the necessary information for verifying the review comment.


Revised Script with File Extension Patterns

The previous script encountered issues with unrecognized file types. To ensure all TypeScript files are correctly searched, the updated script uses glob patterns to target .ts and .tsx files directly.

This revised script eliminates the reliance on --type flags and instead uses --glob patterns to target .ts and .tsx files. Executing this script will accurately identify all relevant TypeScript files and any necessary documentation updates related to motionLightTrace, trigger, and action.


Verification Successful: No Impact on Dependent Code Found

The changes to triggers and actions in motion-light-trace.ts are localized. No usages of the old trigger or action keys were found in other TypeScript files, indicating no impact on dependent code.

  • Files using motionLightTrace:
    • gallery/src/pages/automation/trace.ts
    • gallery/src/data/traces/motion-light-trace.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find usages of motionLightTrace and potential areas needing updates

# Search for files using motionLightTrace
echo "Files using motionLightTrace:"
rg --type typescript "motionLightTrace" --files-with-matches

# Search for potential usages of the old 'trigger' and 'action' keys
echo "\nPotential usages of old 'trigger' key:"
rg --type typescript "motionLightTrace.*trigger[^s]"

echo "\nPotential usages of old 'action' key:"
rg --type typescript "motionLightTrace.*action[^s]"

# Search for documentation files that might need updates
echo "\nDocumentation files that might need updates:"
rg --type markdown "motionLightTrace|trigger|action"

Length of output: 3720


Script:

#!/bin/bash
# Description: Find usages of motionLightTrace and potential areas needing updates

# Search for files using motionLightTrace
echo "Files using motionLightTrace:"
rg --type ts --type tsx "motionLightTrace" --files-with-matches

# Search for potential usages of the old 'trigger' key
echo "\nPotential usages of old 'trigger' key:"
rg --type ts --type tsx "motionLightTrace.*trigger[^s]"

# Search for potential usages of the old 'action' key
echo "\nPotential usages of old 'action' key:"
rg --type ts --type tsx "motionLightTrace.*action[^s]"

# Search for documentation files that might need updates
echo "\nDocumentation files that might need updates:"
rg --type markdown "motionLightTrace|trigger|action"

Length of output: 3708


Script:

#!/bin/bash
# Description: Find usages of motionLightTrace and potential areas needing updates

# Search for files using motionLightTrace
echo "Files using motionLightTrace:"
rg --type typescript --type typescriptreact "motionLightTrace" --files-with-matches

# Search for potential usages of the old 'trigger' key
echo "\nPotential usages of old 'trigger' key:"
rg --type typescript --type typescriptreact "motionLightTrace.*trigger[^s]"

# Search for potential usages of the old 'action' key
echo "\nPotential usages of old 'action' key:"
rg --type typescript --type typescriptreact "motionLightTrace.*action[^s]"

# Search for documentation files that might need updates
echo "\nDocumentation files that might need updates:"
rg --type markdown "motionLightTrace|trigger|action"

Length of output: 3789


Script:

#!/bin/bash
# Description: Find usages of motionLightTrace and potential areas needing updates

# Search for files using motionLightTrace
echo "Files using motionLightTrace:"
rg "motionLightTrace" --glob "*.ts" --glob "*.tsx" --files-with-matches

# Search for potential usages of the old 'trigger' key
echo "\nPotential usages of old 'trigger' key:"
rg "motionLightTrace.*trigger[^s]" --glob "*.ts" --glob "*.tsx"

# Search for potential usages of the old 'action' key
echo "\nPotential usages of old 'action' key:"
rg "motionLightTrace.*action[^s]" --glob "*.ts" --glob "*.tsx"

# Search for documentation files that might need updates
echo "\nDocumentation files that might need updates:"
rg "motionLightTrace|trigger|action" --type markdown

Length of output: 3732

piitaya
piitaya previously approved these changes Sep 24, 2024
@bramkragten bramkragten merged commit cbce6f6 into dev Sep 24, 2024
13 checks passed
@bramkragten bramkragten deleted the migrate-automation-config branch September 24, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Design Related to Home Assistant design gallery wait for backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants