-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add Blueprint Editor #25646
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
Open
jpitlor
wants to merge
53
commits into
home-assistant:dev
Choose a base branch
from
jpitlor:blueprint-editor
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Blueprint Editor #25646
Changes from 48 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
3f8a333
Initial implementation of blueprint editor
jpitlor bd1a339
Some bug fixes
jpitlor 4f279ff
Remove unneeded changes
jpitlor 2559877
Add blueprint input sections
jpitlor bc0aed3
Remove remaining errors
jpitlor cd1e691
Remove remaining errors
jpitlor 9ec09f4
Remove comments and TODOs
jpitlor 1a08110
Merge `dev`
jpitlor 77a5749
Remove unused imports
jpitlor e2e9463
Remove invalid selector types
jpitlor 68efa04
Fix incorrect redirect after saving blueprint bug
jpitlor 9b52197
Add TODOs for inputs in YAML
jpitlor 24d8c0e
Add support for arbitrary inputs in YAML editors for blueprints
jpitlor 43ec029
Remove unused translations for blueprints
jpitlor 9abcd09
Fix YAML related error
jpitlor 2f5bd91
Fix Save Blueprint API call
jpitlor 8cd1a3d
Merge branch 'dev' into blueprint-editor
jpitlor c1a2872
Utilize selector selector
jpitlor 2caf3e7
Merge remote-tracking branch 'origin/blueprint-editor' into blueprint…
jpitlor 4c2e56a
Merge branch 'dev' into blueprint-editor
jpitlor e297c96
Make strings sentence case
jpitlor 6a7f1ed
Merge branch 'dev' into blueprint-editor
jpitlor b4f24e2
Merge branch 'dev' into blueprint-editor
jpitlor 493e1ba
Fix lint errors
jpitlor 9416a69
Update src/translations/en.json
jpitlor 22ecfe2
Merge branch 'dev' into blueprint-editor
jpitlor 9726405
Fix lint errors
jpitlor 03f8efc
Merge branch 'dev' into blueprint-editor
jpitlor 9ed16b1
Move blueprint editor to new developer tools tab
jpitlor ea04c47
Move add metadata to the editor
jpitlor 69b9191
Merge branch 'refs/heads/dev' into blueprint-editor
jpitlor 81f554d
Made some initial progress on moving the blueprint editor to develope…
jpitlor ed5e831
Merge branch 'dev' into blueprint-editor
jpitlor 37a5cbb
More progress on Blueprint Editor
jpitlor a45f954
Merge branch 'refs/heads/dev' into blueprint-editor
jpitlor 2b4eaa8
Finish moving blueprint editor to developer tools
jpitlor c7f0d47
Merge branch 'dev' into blueprint-editor
jpitlor 77592a2
Remove old changes that are no longer needed
jpitlor 7eb647d
Fix bug where blueprint never loads
jpitlor 35ea7fc
Merge branch 'dev' into blueprint-editor
jpitlor 6062838
Merge branch 'dev' into blueprint-editor
jpitlor fd7147b
Fix lint error
jpitlor 3756a8c
Merge remote-tracking branch 'origin/blueprint-editor' into blueprint…
jpitlor ce7f25d
Merge branch 'dev' into blueprint-editor
jpitlor 81ff174
Merge branch 'dev' into blueprint-editor
jpitlor 0bf26b9
Fix lint errors
jpitlor 0655441
Merge remote-tracking branch 'origin/blueprint-editor' into blueprint…
jpitlor bca2419
Merge branch 'dev' into blueprint-editor
jpitlor 81f96ce
Update src/panels/config/automation/condition/ha-automation-condition…
jpitlor cf87080
Update src/panels/config/automation/trigger/ha-automation-trigger-row.ts
jpitlor 8d9f819
Update src/panels/config/automation/trigger/ha-automation-trigger-row.ts
jpitlor a36917c
Blueprint Editor:
jpitlor b46dfe6
Merge branch 'dev' into blueprint-editor
jpitlor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| import { customElement, property, query } from "lit/decorators"; | ||
| import { classMap } from "lit/directives/class-map"; | ||
| import memoizeOne from "memoize-one"; | ||
| import { DEFAULT_SCHEMA, Schema } from "js-yaml"; | ||
| import { dynamicElement } from "../../../../common/dom/dynamic-element-directive"; | ||
| import { fireEvent } from "../../../../common/dom/fire_event"; | ||
| import "../../../../components/ha-yaml-editor"; | ||
|
|
@@ -13,6 +14,8 @@ | |
| import "../ha-automation-editor-warning"; | ||
| import { editorStyles, indentStyle } from "../styles"; | ||
| import type { ConditionElement } from "./ha-automation-condition-row"; | ||
| import { consume } from "@lit/context"; | ||
|
||
| import { yamlSchemaContext } from "../../../../data/blueprint"; | ||
|
|
||
| @customElement("ha-automation-condition-editor") | ||
| export default class HaAutomationConditionEditor extends LitElement { | ||
|
|
@@ -40,6 +43,9 @@ | |
| @query(COLLAPSIBLE_CONDITION_ELEMENTS.join(", ")) | ||
| private _collapsibleElement?: ConditionElement; | ||
|
|
||
| @consume({ context: yamlSchemaContext }) | ||
| private _yamlSchema?: Schema; | ||
|
|
||
| private _processedCondition = memoizeOne((condition) => | ||
| expandConditionWithShorthand(condition) | ||
| ); | ||
|
|
@@ -74,22 +80,23 @@ | |
| ></ha-automation-editor-warning> | ||
| ` | ||
| : nothing} | ||
| <ha-yaml-editor | ||
| .hass=${this.hass} | ||
| .defaultValue=${this.condition} | ||
| @value-changed=${this._onYamlChange} | ||
| .readOnly=${this.disabled} | ||
| ></ha-yaml-editor> | ||
| ` | ||
| : html` | ||
| <div @value-changed=${this._onUiChanged}> | ||
| ${dynamicElement( | ||
| `ha-automation-condition-${condition.condition}`, | ||
| { | ||
| hass: this.hass, | ||
| condition: condition, | ||
| disabled: this.disabled, | ||
| optionsInSidebar: this.indent, | ||
| <ha-yaml-editor | ||
| .hass=${this.hass} | ||
| .defaultValue=${this.condition} | ||
| @value-changed=${this._onYamlChange} | ||
| .readOnly=${this.disabled} | ||
| .yamlSchema=${this._yamlSchema ?? DEFAULT_SCHEMA} | ||
| ></ha-yaml-editor> | ||
| ` | ||
| : html` | ||
| <div @value-changed=${this._onUiChanged}> | ||
| ${dynamicElement( | ||
| `ha-automation-condition-${condition.condition}`, | ||
| { | ||
| hass: this.hass, | ||
| condition: condition, | ||
| disabled: this.disabled, | ||
| optionsInSidebar: this.indent, | ||
| narrow: this.narrow, | ||
| } | ||
| )} | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.