Remove redundant comments and improve code formatting
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
/**
|
||||
* Sensors API Service
|
||||
* Handles sensor-related API calls
|
||||
*/
|
||||
import {
|
||||
apiClient,
|
||||
type SensorInfo,
|
||||
@@ -13,9 +9,6 @@ import {
|
||||
} from './api'
|
||||
|
||||
export const sensorsApi = {
|
||||
/**
|
||||
* Get all sensors with optional filtering
|
||||
*/
|
||||
async getSensors(params?: {
|
||||
room?: string
|
||||
sensor_type?: SensorType
|
||||
@@ -24,16 +17,10 @@ export const sensorsApi = {
|
||||
return apiClient.get<SensorInfo[]>('/api/v1/sensors', params)
|
||||
},
|
||||
|
||||
/**
|
||||
* Get detailed information about a specific sensor
|
||||
*/
|
||||
async getSensor(sensorId: string): Promise<SensorInfo> {
|
||||
return apiClient.get<SensorInfo>(`/api/v1/sensors/${sensorId}`)
|
||||
},
|
||||
|
||||
/**
|
||||
* Get historical data for a specific sensor
|
||||
*/
|
||||
async getSensorData(
|
||||
sensorId: string,
|
||||
params?: {
|
||||
@@ -46,16 +33,10 @@ export const sensorsApi = {
|
||||
return apiClient.get<DataResponse>(`/api/v1/sensors/${sensorId}/data`, params)
|
||||
},
|
||||
|
||||
/**
|
||||
* Advanced data query with multiple filters
|
||||
*/
|
||||
async queryData(query: DataQuery): Promise<DataResponse> {
|
||||
return apiClient.post<DataResponse>('/api/v1/data/query', query)
|
||||
},
|
||||
|
||||
/**
|
||||
* Update sensor metadata
|
||||
*/
|
||||
async updateSensorMetadata(
|
||||
sensorId: string,
|
||||
metadata: Record<string, any>,
|
||||
@@ -63,9 +44,6 @@ export const sensorsApi = {
|
||||
return apiClient.put<{ message: string }>(`/api/v1/sensors/${sensorId}/metadata`, metadata)
|
||||
},
|
||||
|
||||
/**
|
||||
* Delete sensor and all its data
|
||||
*/
|
||||
async deleteSensor(sensorId: string): Promise<{
|
||||
message: string
|
||||
readings_deleted: number
|
||||
@@ -74,9 +52,6 @@ export const sensorsApi = {
|
||||
return apiClient.delete(`/api/v1/sensors/${sensorId}`)
|
||||
},
|
||||
|
||||
/**
|
||||
* Export sensor data for specified time range
|
||||
*/
|
||||
async exportData(params: {
|
||||
start_time: number
|
||||
end_time: number
|
||||
|
||||
Reference in New Issue
Block a user