Move data_entry_flow_progressed event subscriber (#7700)

This commit is contained in:
Joakim Sørensen
2020-11-17 15:12:45 +01:00
committed by GitHub
parent af1518e924
commit 8fd1f35c59
3 changed files with 19 additions and 39 deletions

View File

@@ -8,12 +8,8 @@ import {
property,
TemplateResult,
} from "lit-element";
import { fireEvent } from "../../common/dom/fire_event";
import "../../components/ha-circular-progress";
import {
DataEntryFlowProgressedEvent,
DataEntryFlowStepProgress,
} from "../../data/data_entry_flow";
import { DataEntryFlowStepProgress } from "../../data/data_entry_flow";
import { HomeAssistant } from "../../types";
import { FlowConfig } from "./show-dialog-data-entry-flow";
import { configFlowContentStyles } from "./styles";
@@ -43,22 +39,6 @@ class StepFlowProgress extends LitElement {
`;
}
protected firstUpdated(changedProps) {
super.firstUpdated(changedProps);
this.hass.connection.subscribeEvents<DataEntryFlowProgressedEvent>(
async (ev) => {
if (ev.data.flow_id !== this.step.flow_id) {
return;
}
fireEvent(this, "flow-update", {
stepPromise: this.flowConfig.fetchFlow(this.hass, this.step.flow_id),
});
},
"data_entry_flow_progressed"
);
}
static get styles(): CSSResult[] {
return [
configFlowContentStyles,