Skip to content

Commit

Permalink
Remove battery/pv configured properties (evcc-io#12498)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored and thierolm committed Mar 20, 2024
1 parent 5f3e75d commit 0411ff9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
8 changes: 6 additions & 2 deletions assets/js/components/Site.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ export default {
gridConfigured: Boolean,
gridPower: Number,
homePower: Number,
pvConfigured: Boolean,
pvPower: Number,
pv: Array,
batteryConfigured: Boolean,
batteryPower: Number,
batterySoc: Number,
batteryDischargeControl: Boolean,
Expand Down Expand Up @@ -104,6 +102,12 @@ export default {
smartCostActive: Boolean,
},
computed: {
batteryConfigured: function () {
return this.battery?.length;
},
pvConfigured: function () {
return this.pv?.length;
},
energyflow: function () {
return this.collectProps(Energyflow);
},
Expand Down
5 changes: 4 additions & 1 deletion assets/js/components/TopNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,17 @@ export default {
},
sponsor: String,
sponsorTokenExpires: Number,
batteryConfigured: Boolean,
battery: Array,
},
data() {
return {
isApp: isApp(),
};
},
computed: {
batteryConfigured: function () {
return this.battery?.length;
},
logoutCount() {
return this.providerLogins.filter((login) => !login.loggedIn).length;
},
Expand Down
2 changes: 1 addition & 1 deletion assets/js/views/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
},
computed: {
batteryModalAvailabe: function () {
return store.state.batteryConfigured;
return store.state.battery?.length;
},
globalSettingsProps: function () {
return this.collectProps(GlobalSettingsModal, store.state);
Expand Down
12 changes: 5 additions & 7 deletions core/keys/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const (
HomePower = "homePower"
PrioritySoc = "prioritySoc"
Pv = "pv"
PvConfigured = "pvConfigured"
PvEnergy = "pvEnergy"
PvPower = "pvPower"
ResidualPower = "residualPower"
Expand Down Expand Up @@ -43,10 +42,9 @@ const (
BufferStartSoc = "bufferStartSoc"

// battery status
Battery = "battery"
BatteryConfigured = "batteryConfigured"
BatteryEnergy = "batteryEnergy"
BatteryMode = "batteryMode"
BatteryPower = "batteryPower"
BatterySoc = "batterySoc"
Battery = "battery"
BatteryEnergy = "batteryEnergy"
BatteryMode = "batteryMode"
BatteryPower = "batteryPower"
BatterySoc = "batterySoc"
)
4 changes: 2 additions & 2 deletions core/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,8 @@ func (site *Site) prepare() {
site.publish(keys.SiteTitle, site.Title)

site.publish(keys.GridConfigured, site.gridMeter != nil)
site.publish(keys.PvConfigured, len(site.pvMeters) > 0)
site.publish(keys.BatteryConfigured, len(site.batteryMeters) > 0)
site.publish(keys.Pv, make([]api.Meter, len(site.pvMeters)))
site.publish(keys.Battery, make([]api.Meter, len(site.batteryMeters)))
site.publish(keys.BufferSoc, site.bufferSoc)
site.publish(keys.BufferStartSoc, site.bufferStartSoc)
site.publish(keys.PrioritySoc, site.prioritySoc)
Expand Down

0 comments on commit 0411ff9

Please sign in to comment.