mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 18:10:47 -04:00
horn limits and such
This commit is contained in:
@@ -30,6 +30,7 @@ function createSongState() {
|
||||
function createHornState() {
|
||||
return {
|
||||
active: false,
|
||||
cooldownUntil: 0,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -144,6 +145,14 @@ export function controlReducer(state, action) {
|
||||
active: Boolean(action.payload),
|
||||
},
|
||||
};
|
||||
case 'control/set-horn-cooldown':
|
||||
return {
|
||||
...state,
|
||||
horn: {
|
||||
...(state.horn || createHornState()),
|
||||
cooldownUntil: typeof action.payload === 'number' ? action.payload : 0,
|
||||
},
|
||||
};
|
||||
case 'control/record-intent':
|
||||
return {
|
||||
...state,
|
||||
|
||||
Reference in New Issue
Block a user