chore: Enable noImplicitAny across the codebase (#2667)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { getConfiguredPTZPresetAction } from '../../../camera-manager/utils/ptz';
|
||||
import type { PTZActionConfig } from '../../../config/schema/actions/custom/ptz';
|
||||
import { PTZMovementType } from '../../../types';
|
||||
import { getPTZTarget, ptzActionToCapabilityKey } from '../../../utils/ptz';
|
||||
@@ -62,7 +63,7 @@ export class PTZAction extends AdvancedCameraCardAction<PTZActionConfig> {
|
||||
// and the home button always targets `presets[0]`, ignoring the
|
||||
// configured action. See:
|
||||
// https://github.com/dermotduffy/advanced-camera-card/issues/2525
|
||||
if (ptzConfiguration.presets?.['home']) {
|
||||
if (getConfiguredPTZPresetAction(ptzConfiguration, 'home')) {
|
||||
await api.getCameraManager().executePTZAction(ptzCameraID, 'preset', {
|
||||
phase: action.ptz_phase,
|
||||
preset: 'home',
|
||||
|
||||
@@ -97,29 +97,25 @@ export class StyleManager {
|
||||
}
|
||||
|
||||
private _setPerformance(): void {
|
||||
const STYLE_DISABLE_MAP = {
|
||||
box_shadow: {
|
||||
cssKey: '--advanced-camera-card-box-shadow-override',
|
||||
value: 'none',
|
||||
},
|
||||
border_radius: {
|
||||
cssKey: '--advanced-camera-card-border-radius-override',
|
||||
value: '0px',
|
||||
},
|
||||
};
|
||||
const element = this._api.getCardElementManager().getElement();
|
||||
const performance = this._api.getConfigManager().getCardWideConfig()?.performance;
|
||||
|
||||
const styles = performance?.style ?? {};
|
||||
for (const configKey of Object.keys(styles)) {
|
||||
const mapping = STYLE_DISABLE_MAP[configKey];
|
||||
setOrRemoveStyleProperty(
|
||||
element,
|
||||
!styles[configKey],
|
||||
mapping.cssKey,
|
||||
mapping.value,
|
||||
);
|
||||
const styles = this._api.getConfigManager().getCardWideConfig()?.performance?.style;
|
||||
if (!styles) {
|
||||
return;
|
||||
}
|
||||
|
||||
const element = this._api.getCardElementManager().getElement();
|
||||
|
||||
setOrRemoveStyleProperty(
|
||||
element,
|
||||
!styles.box_shadow,
|
||||
'--advanced-camera-card-box-shadow-override',
|
||||
'none',
|
||||
);
|
||||
setOrRemoveStyleProperty(
|
||||
element,
|
||||
!styles.border_radius,
|
||||
'--advanced-camera-card-border-radius-override',
|
||||
'0px',
|
||||
);
|
||||
}
|
||||
|
||||
private _isAspectRatioEnforced(
|
||||
|
||||
@@ -153,7 +153,7 @@ export class TemplateManager implements TemplateRenderer {
|
||||
this._renderTemplateRecursively(hass, item, templateContext),
|
||||
);
|
||||
} else if (isRecord(data)) {
|
||||
const result = {};
|
||||
const result: Record<string, unknown> = {};
|
||||
for (const key in data) {
|
||||
result[key] = this._renderTemplateRecursively(hass, data[key], templateContext);
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@ import type { ViewContext } from 'view';
|
||||
import type { View } from '../../../view/view';
|
||||
import type { ViewModifier } from '../types';
|
||||
|
||||
export class RemoveContextPropertyViewModifier implements ViewModifier {
|
||||
private _key: keyof ViewContext;
|
||||
private _property: PropertyKey;
|
||||
export class RemoveContextPropertyViewModifier<T extends keyof ViewContext>
|
||||
implements ViewModifier
|
||||
{
|
||||
private _key: T;
|
||||
private _property: keyof NonNullable<ViewContext[T]>;
|
||||
|
||||
constructor(key: keyof ViewContext, property: PropertyKey) {
|
||||
constructor(key: T, property: keyof NonNullable<ViewContext[T]>) {
|
||||
this._key = key;
|
||||
this._property = property;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user