-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: updates to useHeldButtonAction to get press/release working. Up…
…dates to volume control
- Loading branch information
Showing
11 changed files
with
68 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
export * from "./useGetDeviceStateFromRoomConfiguration"; | ||
// export * from "./usePressHoldRelease" | ||
export * from "./interfaces"; | ||
export * from "./useDeviceIBasicVolumeWithFeedback"; | ||
export * from "./useGetDeviceStateFromRoomConfiguration"; | ||
export * from "./usePressHoldRelease"; | ||
export * from "./useRoomIBasicVolumeWithFeedback"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 7 additions & 9 deletions
16
src/lib/shared/hooks/interfaces/useIBasicVolumeWithFeedback.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useGetDevice } from 'src/lib/store'; | ||
import { Volume } from 'src/lib/types'; | ||
import { useIBasicVolumeWithFeedback } from './interfaces/useIBasicVolumeWithFeedback'; | ||
|
||
/** | ||
* Wrapper hook for a device volume | ||
* @param deviceKey | ||
* @returns | ||
*/ | ||
export function useDeviceIBasicVolumeWithFeedback(deviceKey: string ) { | ||
const volumeState = useGetDevice<Volume>(deviceKey); | ||
|
||
const path = `/device/${deviceKey}`; | ||
|
||
return useIBasicVolumeWithFeedback(path, volumeState); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useRoomVolume } from 'src/lib/store'; | ||
import { RoomVolumeType } from 'src/lib/types'; | ||
import { useIBasicVolumeWithFeedback } from './interfaces/useIBasicVolumeWithFeedback'; | ||
|
||
/** | ||
* Wrapper hook for the room volumes | ||
* @param roomKey | ||
* @param type either master or they key of the aux volume | ||
* @returns | ||
*/ | ||
export function useRoomIBasicVolumeWithFeedback(roomKey: string, type: RoomVolumeType ) { | ||
const volumeState = useRoomVolume(roomKey, type); | ||
|
||
const path = `/room/${roomKey}/volumes/${type}`; | ||
|
||
return useIBasicVolumeWithFeedback(path, volumeState); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters