Skip to content

Commit

Permalink
Merge pull request #33 from PepperDash/feature/temp-humidity-sensor-h…
Browse files Browse the repository at this point in the history
…ooks

Feature/temp humidity sensor hooks
  • Loading branch information
ndorin authored Oct 29, 2024
2 parents 388d868 + 45956b8 commit 617c7c0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib/shared/hooks/interfaces/useDevicePresetsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export function useDevicePresetsModel(key: string): DevicePresetsModelProps | un
if (!state) return undefined;

const recallPreset = (deviceKey: string, preset: PresetChannel) => {
sendMessage(`${path}/recall`, {deviceKey, preset});
sendMessage(`${path}/presets/recall`, {deviceKey, preset});
}

const savePresets = (presets: PresetChannel[]) => {
sendMessage(`${path}/save`, presets);
sendMessage(`${path}/presets/save`, presets);
}


Expand Down
4 changes: 3 additions & 1 deletion src/lib/store/appConfig/appConfigSelectors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { AppConfigExtras } from 'src/lib/types';
import { useAppSelector } from '../hooks';

export const useAppConfig = () => useAppSelector((state) => state.appConfig.config);
// Temporary cast to AppConfigExtras until the data is moved to a websocket message
export const useAppConfig = () => useAppSelector((state) => state.appConfig.config) as AppConfigExtras;

export const useApiPath = () => useAppSelector((state) => state.appConfig.config.apiPath);

Expand Down
46 changes: 46 additions & 0 deletions src/lib/types/classes/app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,49 @@ export interface AppConfig {
loginMode: string;
modes: { [key: string]: unknown };
}


// This data should move to a websocket message so as not to requre the local config file to be updated
export interface AppConfigExtras extends AppConfig {
partnerMetadata?: PartnerMetadata[];
roomCombineStyles: {
wallFbStyle: BootstrapColor;
}
audioStyles?: {
audioVariant: AudioVariant;
volumeUpIconStyle: string;
volumeDownIconStyle: string;
}
techMenu?: {
leftNav: {
about: TechMenuNavItemConfig;
audio: TechMenuNavItemConfig;
changePin: TechMenuNavItemConfig;
displays: TechMenuNavItemConfig;
environment: TechMenuNavItemConfig;
matrixRouting: TechMenuNavItemConfig;
roomSetup: TechMenuNavItemConfig;
setTopBox: TechMenuNavItemConfig;
systemStatus: TechMenuNavItemConfig;
}
}
}

type BootstrapColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';

type AudioVariant = "dangerFeedback";

export interface TechMenuNavItemConfig {
label?: string;
enabled?: boolean;
}

/**
* @interface
* Contains metadata for partners
*/
export interface PartnerMetadata {
role: string;
description: string;
logoPath: string;
}

0 comments on commit 617c7c0

Please sign in to comment.