summaryrefslogtreecommitdiff
path: root/src/store/modules/Control/PowerConsumptionStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/Control/PowerConsumptionStore.js')
-rw-r--r--src/store/modules/Control/PowerConsumptionStore.js32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/store/modules/Control/PowerConsumptionStore.js b/src/store/modules/Control/PowerConsumptionStore.js
deleted file mode 100644
index bdc97518..00000000
--- a/src/store/modules/Control/PowerConsumptionStore.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import api from '../../api';
-
-const PowerConsumptionStore = {
- namespaced: true,
- state: {
- powerConsumption: false
- },
- getters: {
- powerConsumption: state => state.powerConsumption
- },
- mutations: {
- setPowerConsumption: (state, powerConsumption) =>
- (state.powerConsumption = powerConsumption)
- },
- actions: {
- getPowerData({ commit }) {
- api
- .get('/xyz/openbmc_project/sensors/power/total_power')
- .then(response => {
- const powerData = response.data.data;
- let powerConsumption =
- powerData.Value * Math.pow(10, powerData.Scale);
- commit('setPowerConsumption', powerConsumption);
- })
- .catch(error => {
- console.log('Power Consumption', error);
- });
- }
- }
-};
-
-export default PowerConsumptionStore;