WIP- need to test against staging
parent
ebe8aa61cc
commit
700be3a62a
|
@ -12,7 +12,8 @@ import {
|
|||
EXPECTED_MAJOR,
|
||||
EXPECTED_MINOR,
|
||||
commandOK,
|
||||
badVersion
|
||||
badVersion,
|
||||
commandErr
|
||||
} from "../devices/actions";
|
||||
import { init } from "../api/crud";
|
||||
import { AuthState } from "../auth/interfaces";
|
||||
|
@ -90,7 +91,7 @@ export function readStatus() {
|
|||
const noun = "'Read Status' command";
|
||||
return getDevice()
|
||||
.readStatus()
|
||||
.then(() => { commandOK(noun); }, () => { });
|
||||
.then(() => { commandOK(noun); }, commandErr(noun));
|
||||
}
|
||||
|
||||
export const onOffline = () => {
|
||||
|
|
|
@ -46,7 +46,8 @@ export function isLog(x: any): x is Log {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
const commandErr = (_noun = "Command") => () => { };
|
||||
export const commandErr =
|
||||
(noun = "Command") => () => error(t(`${noun} failed`));
|
||||
|
||||
export const commandOK = (noun = "Command") => () => {
|
||||
const msg = noun + " request sent to device.";
|
||||
|
|
|
@ -7,9 +7,11 @@ import { axisTrackingStatus } from "../axis_tracking_status";
|
|||
import { ToolTips } from "../../../constants";
|
||||
import { Row, Col } from "../../../ui/index";
|
||||
import { CalibrationRowProps } from "../interfaces";
|
||||
import { commandErr } from "../../actions";
|
||||
|
||||
const calibrate =
|
||||
(axis: Axis) => getDevice().calibrate({ axis }).catch(() => { });
|
||||
const calibrate = (axis: Axis) => getDevice()
|
||||
.calibrate({ axis })
|
||||
.catch(commandErr("Calibration"));
|
||||
|
||||
export function CalibrationRow(props: CalibrationRowProps) {
|
||||
|
||||
|
|
|
@ -9,10 +9,12 @@ import { ToolTips } from "../../../constants";
|
|||
import { SpacePanelToolTip } from "../space_panel_tool_tip";
|
||||
import { Row, Col } from "../../../ui/index";
|
||||
import { CONFIG_DEFAULTS } from "farmbot/dist/config";
|
||||
import { commandErr } from "../../actions";
|
||||
|
||||
const speed = CONFIG_DEFAULTS.speed;
|
||||
const findHome =
|
||||
(axis: Axis) => getDevice().findHome({ speed, axis }).catch(() => { });
|
||||
const findHome = (axis: Axis) => getDevice()
|
||||
.findHome({ speed, axis })
|
||||
.catch(commandErr("'Find Home' request"));
|
||||
|
||||
export function HomingRow(props: HomingRowProps) {
|
||||
const { hardware, botDisconnected } = props;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import axios from "axios";
|
||||
import { API } from "../api";
|
||||
|
||||
export const snapshotGarden = () => axios
|
||||
.post<void>(API.current.snapshotPath)
|
||||
.then(() => { });
|
||||
export const snapshotGarden =
|
||||
() => axios.post<void>(API.current.snapshotPath).then(() => { });
|
||||
|
|
Loading…
Reference in New Issue