diff options
Diffstat (limited to 'src/store/modules')
-rw-r--r-- | src/store/modules/Control/PowerCapStore.js | 12 | ||||
-rw-r--r-- | src/store/modules/Control/PowerConsumptionStore.js | 7 |
2 files changed, 6 insertions, 13 deletions
diff --git a/src/store/modules/Control/PowerCapStore.js b/src/store/modules/Control/PowerCapStore.js index bef9f47b..45a06adb 100644 --- a/src/store/modules/Control/PowerCapStore.js +++ b/src/store/modules/Control/PowerCapStore.js @@ -3,18 +3,14 @@ import api from '../../api'; const PowerCapStore = { namespaced: true, state: { - powerCapData: null, - powerCapValue: 'Not enabled' + powerCapData: false }, getters: { - powerCapData: state => state.powerCapData, - powerCapValue: state => state.powerCapValue + powerCapData: state => state.powerCapData }, mutations: { setPowerCapData: (state, powerCapData) => - (state.powerCapData = powerCapData), - setPowerCapValue: (state, powerCapValue) => - (state.powerCapValue = powerCapValue) + (state.powerCapData = powerCapData) }, actions: { getPowerCapData({ commit }) { @@ -23,7 +19,7 @@ const PowerCapStore = { .then(response => { const powerCapData = response.data.data; if (powerCapData.PowerCapEnable) { - commit('setPowerCapValue', powerCapData.PowerCap + ' W'); + commit('setPowerCapData', powerCapData.PowerCap); } }) .catch(error => { diff --git a/src/store/modules/Control/PowerConsumptionStore.js b/src/store/modules/Control/PowerConsumptionStore.js index 03ccffce..bdc97518 100644 --- a/src/store/modules/Control/PowerConsumptionStore.js +++ b/src/store/modules/Control/PowerConsumptionStore.js @@ -3,15 +3,12 @@ import api from '../../api'; const PowerConsumptionStore = { namespaced: true, state: { - powerData: null, - powerConsumption: 'Not available' + powerConsumption: false }, getters: { - powerData: state => state.powerData, powerConsumption: state => state.powerConsumption }, mutations: { - setPowerData: (state, powerData) => (state.powerData = powerData), setPowerConsumption: (state, powerConsumption) => (state.powerConsumption = powerConsumption) }, @@ -22,7 +19,7 @@ const PowerConsumptionStore = { .then(response => { const powerData = response.data.data; let powerConsumption = - powerData.Value * Math.pow(10, powerData.Scale) + ' W'; + powerData.Value * Math.pow(10, powerData.Scale); commit('setPowerConsumption', powerConsumption); }) .catch(error => { |