-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Show which state changed events a template listeners for in dev tools #6939
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
Merged
Merged
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
ccabd78
Show which state changed events a template listeners for in dev tools
bdraco b16d7ef
Update src/data/ws-templates.ts
bdraco bd4495e
Update src/data/ws-templates.ts
bdraco 8b98238
Update src/panels/developer-tools/template/developer-tools-template.ts
bdraco 3916574
Update src/panels/developer-tools/template/developer-tools-template.ts
bdraco 0d9046a
Update src/panels/developer-tools/template/developer-tools-template.ts
bdraco bdb216e
Update src/panels/developer-tools/template/developer-tools-template.ts
bdraco a4249e9
merge
bdraco a488225
Update src/panels/lovelace/cards/hui-markdown-card.ts
bdraco ad8bba4
fix string reversal
bdraco 28e6790
Update src/panels/lovelace/cards/hui-markdown-card.ts
bdraco f8bc180
Update src/panels/developer-tools/template/developer-tools-template.ts
bdraco cb41fcd
error to string
bdraco 0dd0dc2
cleanup
bdraco c207465
cleanup
bdraco 85ae280
no listeners is probably worth warning about as well
bdraco 3015b38
handle unknown error
bdraco cbd5156
fix error alignment in pre
bdraco 0c81dc5
fix error alignment in pre
bdraco 9b98447
fix error alignment in pre
bdraco 4f79df0
fix error alignment in pre
bdraco d4b478c
Merge branch 'show_listen' of github.com:bdraco/frontend into show_li…
bdraco 6bd30d0
reformat
bdraco 757a3a8
reformat
bdraco aba77bc
reformat
bdraco 9a756f2
fix accidential revert
bdraco ba92a45
Update src/panels/developer-tools/template/developer-tools-template.ts
bdraco 2f4afd8
Update src/panels/developer-tools/template/developer-tools-template.ts
bdraco 1dd7e95
clear error on success
bdraco 068e5cb
tweak to not error if listeners are not returned
bdraco 8f9f98d
Update src/panels/developer-tools/template/developer-tools-template.ts
bdraco 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,27 @@ | ||
| import { Connection, UnsubscribeFunc } from "home-assistant-js-websocket"; | ||
|
|
||
| interface RenderTemplateResult { | ||
| export interface RenderTemplateResult { | ||
| result: string; | ||
| listeners: TemplateListeners; | ||
| } | ||
|
|
||
| interface TemplateListeners { | ||
| all: boolean; | ||
| domains: string[]; | ||
| entities: string[]; | ||
| } | ||
|
|
||
| export const subscribeRenderTemplate = ( | ||
| conn: Connection, | ||
| onChange: (result: string) => void, | ||
| onChange: (result: RenderTemplateResult) => void, | ||
| params: { | ||
| template: string; | ||
| entity_ids?: string | string[]; | ||
| variables?: object; | ||
| } | ||
| ): Promise<UnsubscribeFunc> => { | ||
| return conn.subscribeMessage( | ||
| (msg: RenderTemplateResult) => onChange(msg.result), | ||
| { type: "render_template", ...params } | ||
| ); | ||
| return conn.subscribeMessage((msg: RenderTemplateResult) => onChange(msg), { | ||
| type: "render_template", | ||
| ...params, | ||
| }); | ||
| }; |
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
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.