Rename several view variables for clarity.

This commit is contained in:
Dermot Duffy
2024-06-11 19:48:39 -07:00
parent f193f9925f
commit afb9af5eb4
40 changed files with 769 additions and 285 deletions
+2
View File
@@ -24,6 +24,8 @@ import {
SubscriptionUnsubscribe,
} from './types.js';
export type DestroyCallback = () => Promise<void>;
/**
* Make a HomeAssistant websocket request. May throw.
* @param hass The HomeAssistant object to send the request with.
+15
View File
@@ -0,0 +1,15 @@
import { InteractionMode } from '../config/types';
export const isActionAllowedBasedOnInteractionState = (
interactionMode: InteractionMode,
interactionState: boolean,
): boolean => {
switch (interactionMode) {
case 'all':
return true;
case 'active':
return interactionState;
case 'inactive':
return !interactionState;
}
};