-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch sensor readings from MQTT to REST
- Loading branch information
1 parent
edd0787
commit 7519c55
Showing
11 changed files
with
88 additions
and
80 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,6 +1,7 @@ | ||
TITLE= | ||
BACKEND_URL= | ||
DEVICE_BACKEND_URL= | ||
MQTT_BACKEND_URL= | ||
MQTT_URL= | ||
OAUTH_CLIENT_ID= | ||
VARIANT= |
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,6 +1,7 @@ | ||
TITLE=Fauna | ||
BACKEND_URL=http://localhost:3000/ | ||
DEVICE_BACKEND_URL=http://localhost:4000/ | ||
MQTT_BACKEND_URL=https://mqtt.initlab.org/ | ||
MQTT_URL=ws://localhost:1083/mqtt | ||
OAUTH_CLIENT_ID=hCOEcK3ntyBym-uLQkogX6w8457kicVlZbY0PQZJusw | ||
VARIANT=initlab |
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,4 +1,5 @@ | ||
BACKEND_URL=https://fauna.initlab.org/ | ||
DEVICE_BACKEND_URL=https://portier.initlab.org/ | ||
MQTT_BACKEND_URL=https://mqtt.initlab.org/ | ||
MQTT_URL=wss://spitfire.initlab.org:8083/mqtt | ||
OAUTH_CLIENT_ID=YueB6ct6SKPN8Ar72G0LC1QFxW9meUDQIOHdAu5mfCE |
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,20 +1,24 @@ | ||
import { configureStore } from '@reduxjs/toolkit'; | ||
import { setupListeners } from '@reduxjs/toolkit/query'; | ||
import { anonymousApiSlice, authenticatedApiSlice, authenticatedDeviceApiSlice } from '../features/apiSlice'; | ||
import { sensorSlice } from '../features/sensorSlice'; | ||
import { | ||
anonymousApiSlice, | ||
anonymousMqttApiSlice, | ||
authenticatedApiSlice, | ||
authenticatedDeviceApiSlice | ||
} from '../features/apiSlice'; | ||
import { doorSlice } from '../features/doorSlice.js'; | ||
|
||
export const store = configureStore({ | ||
reducer: { | ||
[anonymousApiSlice.reducerPath]: anonymousApiSlice.reducer, | ||
[anonymousMqttApiSlice.reducerPath]: anonymousMqttApiSlice.reducer, | ||
[authenticatedApiSlice.reducerPath]: authenticatedApiSlice.reducer, | ||
[authenticatedDeviceApiSlice.reducerPath]: authenticatedDeviceApiSlice.reducer, | ||
[sensorSlice.name]: sensorSlice.reducer, | ||
[doorSlice.name]: doorSlice.reducer, | ||
}, | ||
middleware: getDefaultMiddleware => | ||
getDefaultMiddleware().concat(anonymousApiSlice.middleware).concat(authenticatedApiSlice.middleware) | ||
.concat(authenticatedDeviceApiSlice.middleware), | ||
getDefaultMiddleware().concat(anonymousApiSlice.middleware).concat(anonymousMqttApiSlice.middleware) | ||
.concat(authenticatedApiSlice.middleware).concat(authenticatedDeviceApiSlice.middleware), | ||
}); | ||
|
||
setupListeners(store.dispatch); |
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 was deleted.
Oops, something went wrong.
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
32 changes: 27 additions & 5 deletions
32
src/widgets/SensorReadingsWrapper/SensorReadingsWrapper.jsx
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