Consistently use isComponentLoaded() helper (#7995)

This commit is contained in:
Philip Allgaier
2021-01-10 19:52:22 +01:00
committed by GitHub
parent 0d281f8437
commit d02a2e8c2e
5 changed files with 15 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ import {
import { fireEvent } from "../common/dom/fire_event";
import { computeStateName } from "../common/entity/compute_state_name";
import { supportsFeature } from "../common/entity/supports-feature";
import { isComponentLoaded } from "../common/config/is_component_loaded";
import {
CameraEntity,
CAMERA_SUPPORT_STREAM,
@@ -86,7 +87,7 @@ class HaCameraStream extends LitElement {
private get _shouldRenderMJPEG() {
return (
this._forceMJPEG === this.stateObj!.entity_id ||
!this.hass!.config.components.includes("stream") ||
!isComponentLoaded(this.hass!, "stream") ||
!supportsFeature(this.stateObj!, CAMERA_SUPPORT_STREAM)
);
}