({ type: "camera/capabilities", entity_id });
+
export interface WebRTCClientConfiguration {
configuration: RTCConfiguration;
dataChannel?: string;
diff --git a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts
index 59b425b47d..87b027166a 100644
--- a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts
+++ b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts
@@ -100,8 +100,8 @@ export class EntitySettingsHelperTab extends LitElement {
.entry=${this.entry}
.disabled=${this._submitting}
@change=${this._entityRegistryChanged}
- hideName
- hideIcon
+ hide-name
+ hide-icon
>
diff --git a/src/panels/config/entities/entity-registry-settings-editor.ts b/src/panels/config/entities/entity-registry-settings-editor.ts
index da34ca591b..158d281f77 100644
--- a/src/panels/config/entities/entity-registry-settings-editor.ts
+++ b/src/panels/config/entities/entity-registry-settings-editor.ts
@@ -44,6 +44,7 @@ import {
CAMERA_ORIENTATIONS,
CAMERA_SUPPORT_STREAM,
CameraPreferences,
+ fetchCameraCapabilities,
fetchCameraPrefs,
STREAM_TYPE_HLS,
updateCameraPrefs,
@@ -145,9 +146,9 @@ export class EntityRegistrySettingsEditor extends LitElement {
@property({ type: Object }) public entry!: ExtEntityRegistryEntry;
- @property({ type: Boolean }) public hideName = false;
+ @property({ type: Boolean, attribute: "hide-name" }) public hideName = false;
- @property({ type: Boolean }) public hideIcon = false;
+ @property({ type: Boolean, attribute: "hide-icon" }) public hideIcon = false;
@property({ type: Boolean }) public disabled = false;
@@ -236,13 +237,7 @@ export class EntityRegistrySettingsEditor extends LitElement {
if (domain === "camera" && isComponentLoaded(this.hass, "stream")) {
const stateObj: HassEntity | undefined =
this.hass.states[this.entry.entity_id];
- if (
- stateObj &&
- supportsFeature(stateObj, CAMERA_SUPPORT_STREAM) &&
- // The stream component for HLS streams supports a server-side pre-load
- // option that client initiated WebRTC streams do not
- stateObj.attributes.frontend_stream_type === STREAM_TYPE_HLS
- ) {
+ if (stateObj && supportsFeature(stateObj, CAMERA_SUPPORT_STREAM)) {
this._fetchCameraPrefs();
}
}
@@ -1396,6 +1391,19 @@ export class EntityRegistrySettingsEditor extends LitElement {
}
private async _fetchCameraPrefs() {
+ const capabilities = await fetchCameraCapabilities(
+ this.hass,
+ this.entry.entity_id
+ );
+
+ // The stream component for HLS streams supports a server-side pre-load
+ // option that client initiated WebRTC streams do not
+
+ if (!capabilities.frontend_stream_types.includes(STREAM_TYPE_HLS)) {
+ this._cameraPrefs = undefined;
+ return;
+ }
+
this._cameraPrefs = await fetchCameraPrefs(this.hass, this.entry.entity_id);
}