refactor: Retire the use of unmaintained custom-card-helpers (#1956)

- Closes #1295
This commit is contained in:
Dermot Duffy
2025-03-09 16:02:33 -07:00
committed by GitHub
parent c65ee3f0f2
commit a79ffa6edc
116 changed files with 933 additions and 545 deletions
+4 -4
View File
@@ -1,11 +1,11 @@
import { HomeAssistant } from '../../ha/types';
import { localize } from '../../localize/localize';
import { ExtendedHomeAssistant } from '../../types';
import { hasHAConnectionStateChanged } from '../../utils/ha';
import { CardHASSAPI } from '../types';
import { StateWatcher, StateWatcherSubscriptionInterface } from './state-watcher';
export class HASSManager {
protected _hass: ExtendedHomeAssistant | null = null;
protected _hass: HomeAssistant | null = null;
protected _api: CardHASSAPI;
protected _stateWatcher: StateWatcher = new StateWatcher();
@@ -13,7 +13,7 @@ export class HASSManager {
this._api = api;
}
public getHASS(): ExtendedHomeAssistant | null {
public getHASS(): HomeAssistant | null {
return this._hass;
}
@@ -25,7 +25,7 @@ export class HASSManager {
return this._stateWatcher;
}
public setHASS(hass?: ExtendedHomeAssistant | null): void {
public setHASS(hass?: HomeAssistant | null): void {
if (hasHAConnectionStateChanged(this._hass, hass)) {
if (!hass?.connected) {
this._api.getMessageManager().setMessageIfHigherPriority({
+1 -1
View File
@@ -1,4 +1,4 @@
import { HomeAssistant } from '@dermotduffy/custom-card-helpers';
import { HomeAssistant } from '../../ha/types';
import { getHassDifferences, HassStateDifference } from '../../utils/ha';
type StateWatcherCallback = (difference: HassStateDifference) => void;