Refactor to decouple energy, room, and sensor stores
- Remove room and sensor logic from energy store - Update components to use useRoomStore and useSensorStore directly - Fix sensor/room ID mismatches and API response handling in room store - Update AIOptimizationView to use useWebSocketStore for connection status - Update SensorManagementView to use useRoomStore and useSensorStore directly
This commit is contained in:
@@ -70,12 +70,12 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useEnergyStore } from '@/stores/energy'
|
||||
import { useRoomStore } from '@/stores/room'
|
||||
|
||||
const energyStore = useEnergyStore()
|
||||
const roomStore = useRoomStore()
|
||||
|
||||
const roomsList = computed(() => {
|
||||
return Array.from(energyStore.roomsData.values()).sort((a, b) =>
|
||||
return Array.from(roomStore.roomsData.values()).sort((a, b) =>
|
||||
b.co2.current - a.co2.current // Sort by CO2 level descending
|
||||
)
|
||||
})
|
||||
@@ -86,7 +86,7 @@ const overallCO2 = computed(() => {
|
||||
})
|
||||
|
||||
const overallStatus = computed(() => {
|
||||
return energyStore.getCO2Status(overallCO2.value)
|
||||
return roomStore.getCO2Status(overallCO2.value)
|
||||
})
|
||||
|
||||
const roomsWithGoodAir = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user