forked from Github/frigate
Abstract MQTT from communication and make mqtt optional (#4462)
* Add option for mqtt config * Setup communication layer * Have a dispatcher which is responsible for handling and sending messages * Move mqtt to communication * Separate ws communications module * Make ws client conform to communicator * Cleanup imports * Migrate to new dispatcher * Clean up * Need to set topic prefix * Remove references to mqtt in dispatcher * Don't start mqtt until dispatcher is subscribed * Cleanup * Shorten package * Formatting * Remove unused * Cleanup * Rename mqtt to ws on web * Fix ws mypy * Fix mypy * Reformat * Cleanup if/else chain * Catch bad set commands
This commit is contained in:
@@ -3,7 +3,7 @@ import ActivityIndicator from '../components/ActivityIndicator';
|
||||
import Button from '../components/Button';
|
||||
import Heading from '../components/Heading';
|
||||
import Link from '../components/Link';
|
||||
import { useMqtt } from '../api/mqtt';
|
||||
import { useWs } from '../api/ws';
|
||||
import useSWR from 'swr';
|
||||
import axios from 'axios';
|
||||
import { Table, Tbody, Thead, Tr, Th, Td } from '../components/Table';
|
||||
@@ -18,7 +18,7 @@ export default function System() {
|
||||
|
||||
const {
|
||||
value: { payload: stats },
|
||||
} = useMqtt('stats');
|
||||
} = useWs('stats');
|
||||
const { data: initialStats } = useSWR('stats');
|
||||
|
||||
const { cpu_usages, detectors, service = {}, detection_fps: _, ...cameras } = stats || initialStats || emptyObject;
|
||||
|
||||
Reference in New Issue
Block a user