Results of running ts-prune.

This commit is contained in:
Dermot Duffy
2023-01-30 21:11:21 -08:00
parent f3149d2ff3
commit a9074bd44e
27 changed files with 116 additions and 161 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ const deviceSchema = z.object({
config_entries: z.string().array(),
manufacturer: z.string().nullable(),
})
export const deviceListSchema = deviceSchema.array();
const deviceListSchema = deviceSchema.array();
export type DeviceList = z.infer<typeof deviceListSchema>;
/**
+1 -1
View File
@@ -205,7 +205,7 @@ function computeStyle(state: HassEntity): StyleInfo {
* @param stateObj The HassEntity object from `hass.states`.
* @returns A string state, e.g. 'on'.
*/
export const computeActiveState = (stateObj: HassEntity): string => {
const computeActiveState = (stateObj: HassEntity): string => {
const domain = stateObj.entity_id.split('.')[0];
let state = stateObj.state;
+2 -6
View File
@@ -4,11 +4,7 @@ import {
HassEntityBase
} from 'home-assistant-js-websocket';
export const UPDATE_SUPPORT_INSTALL = 1;
export const UPDATE_SUPPORT_SPECIFIC_VERSION = 2;
export const UPDATE_SUPPORT_PROGRESS = 4;
export const UPDATE_SUPPORT_BACKUP = 8;
export const UPDATE_SUPPORT_RELEASE_NOTES = 16;
const UPDATE_SUPPORT_PROGRESS = 4;
interface UpdateEntityAttributes extends HassEntityAttributeBase {
auto_update: boolean | null;
@@ -28,7 +24,7 @@ export interface UpdateEntity extends HassEntityBase {
export const supportsFeature = (stateObj: HassEntity, feature: number): boolean =>
((stateObj.attributes.supported_features ?? 0) & feature) !== 0;
export const updateUsesProgress = (entity: UpdateEntity): boolean =>
const updateUsesProgress = (entity: UpdateEntity): boolean =>
supportsFeature(entity, UPDATE_SUPPORT_PROGRESS) &&
typeof entity.attributes.in_progress === 'number';