@ledvance/base 1.2.46 → 1.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -19,10 +19,15 @@ export interface NativeProps {
|
|
|
19
19
|
energieverbrauch?: object
|
|
20
20
|
moods: any[]
|
|
21
21
|
flags: any[]
|
|
22
|
-
|
|
22
|
+
flagModeState: FlagModeState
|
|
23
23
|
is24HourClock: boolean
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
interface FlagModeState {
|
|
27
|
+
flagMode: boolean
|
|
28
|
+
flagId?: number
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
export interface DeviceInfo {
|
|
27
32
|
devId: string
|
|
28
33
|
pId: string
|
|
@@ -56,7 +61,10 @@ const initialState: NativeProps = {
|
|
|
56
61
|
energieverbrauch: {},
|
|
57
62
|
moods: [],
|
|
58
63
|
flags: [],
|
|
59
|
-
|
|
64
|
+
flagModeState:{
|
|
65
|
+
flagMode: false,
|
|
66
|
+
flagId: undefined
|
|
67
|
+
},
|
|
60
68
|
is24HourClock: true
|
|
61
69
|
}
|
|
62
70
|
|
|
@@ -122,7 +130,7 @@ const nativePropsSlice = createSlice({
|
|
|
122
130
|
state.flags = action.payload
|
|
123
131
|
},
|
|
124
132
|
setFlagMode(state, action: PayloadAction<any>) {
|
|
125
|
-
state.
|
|
133
|
+
state.flagModeState = action.payload
|
|
126
134
|
},
|
|
127
135
|
setGroupDevices(state, action: PayloadAction<any>) {
|
|
128
136
|
state.uaGroupInfo.groupDevices = action.payload
|
|
@@ -249,10 +257,10 @@ const useFlags = (): [any[], (v: any[]) => void] => {
|
|
|
249
257
|
return [dps, setFlagsFn]
|
|
250
258
|
}
|
|
251
259
|
|
|
252
|
-
const useFlagMode = (): [
|
|
253
|
-
const dps = useSelector(store => store.ldvModules.
|
|
260
|
+
const useFlagMode = (): [FlagModeState, (v: FlagModeState) => void] =>{
|
|
261
|
+
const dps = useSelector(store => store.ldvModules.flagModeState)
|
|
254
262
|
const dispatch = useDispatch()
|
|
255
|
-
const setFlagModeFn = (value:
|
|
263
|
+
const setFlagModeFn = (value: FlagModeState) => {
|
|
256
264
|
dispatch(setFlagMode(value))
|
|
257
265
|
}
|
|
258
266
|
return [dps, setFlagModeFn]
|