Refactor stores for modularity and API type updates
- Split energy store into sensor, room, analytics, and websocket stores - Add new analytics, room, sensor, and websocket stores - Update API types for sensors (SensorDevice, SensorAction) - Update sensorsApi to use new SensorDevice type - Add central index for store exports and types - Refactor energy store to delegate to modular stores - Remove legacy code and consolidate API logic
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
apiClient,
|
||||
type SensorInfo,
|
||||
type SensorDevice,
|
||||
type SensorReading,
|
||||
type DataQuery,
|
||||
type DataResponse,
|
||||
@@ -13,12 +13,12 @@ export const sensorsApi = {
|
||||
room?: string
|
||||
sensor_type?: SensorType
|
||||
status?: SensorStatus
|
||||
}): Promise<SensorInfo[]> {
|
||||
return apiClient.get<SensorInfo[]>('/api/v1/sensors/get', params)
|
||||
}): Promise<SensorDevice[]> {
|
||||
return apiClient.get<SensorDevice[]>('/api/v1/sensors/get', params)
|
||||
},
|
||||
|
||||
async getSensor(sensorId: string): Promise<SensorInfo> {
|
||||
return apiClient.get<SensorInfo>(`/api/v1/sensors/${sensorId}`)
|
||||
async getSensor(sensorId: string): Promise<SensorDevice> {
|
||||
return apiClient.get<SensorDevice>(`/api/v1/sensors/${sensorId}`)
|
||||
},
|
||||
|
||||
async getSensorData(
|
||||
|
||||
Reference in New Issue
Block a user