Rename several view variables for clarity.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user