import { resetConfigValue , updateConfigValue } from '../config' ; import type { ResetConfigValueAction , UpdateConfigValueAction , } from '../config/types' ; import * as Constants from './constants' ; import * as Types from './types' ; import type { RobotApiRequestMeta , RobotApiErrorResponse , } from '../robot-api/types' ; export const fetchCalibrationStatus = ( robotName ) : Types . FetchCalibrationStatusAction => ( { type : Constants . FETCH_CALIBRATION_STATUS , payload : { robotName } , meta : { } , } ) ; export const fetchCalibrationStatusSuccess = ( robotName , calibrationStatus , meta ) : Types . FetchCalibrationStatusSuccessAction => ( { type : Constants . FETCH_CALIBRATION_STATUS_SUCCESS , payload : { robotName , calibrationStatus } , meta , } ) ; export const fetchCalibrationStatusFailure = ( robotName , error , meta ) : Types . FetchCalibrationStatusFailureAction => ( { type : Constants . FETCH_CALIBRATION_STATUS_FAILURE , payload : { robotName , error } , meta , } ) ; export function resetUseTrashSurfaceForTipCal ( ) { return resetConfigValue ( 'calibration.useTrashSurfaceForTipCal' ) ; } export function setUseTrashSurfaceForTipCal ( shouldUseTrashSurface ) { return updateConfigValue ( 'calibration.useTrashSurfaceForTipCal' , shouldUseTrashSurface ) ; }