feat: Add hardened error handling and retries (#2451)
- Closes #1830 - Closes #2099
This commit is contained in:
committed by
dermotduffy
parent
4bc787e2b7
commit
47bcce93d3
@@ -7,7 +7,6 @@ import {
|
||||
} from '../const';
|
||||
import { Entity } from '../ha/registry/entity/types';
|
||||
import { supportsFeature } from '../ha/supports-feature';
|
||||
import { localize } from '../localize/localize';
|
||||
import { errorToConsole } from '../utils/basic';
|
||||
import { ViewMedia } from '../view/item';
|
||||
import { ViewItemClassifier } from '../view/item-classifier';
|
||||
@@ -165,12 +164,10 @@ export class MediaPlayerManager {
|
||||
}
|
||||
|
||||
const dashboardConfig = cameraConfig.cast?.dashboard;
|
||||
|
||||
// Guaranteed by schema refinement when cast.method is 'dashboard', but
|
||||
// needed for TypeScript narrowing since refine() doesn't narrow types.
|
||||
if (!dashboardConfig?.dashboard_path || !dashboardConfig?.view_path) {
|
||||
this._api.getMessageManager().setMessageIfHigherPriority({
|
||||
type: 'error',
|
||||
icon: 'mdi:cast',
|
||||
message: localize('error.no_dashboard_or_view'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user