mrsimpson / energy

A calculator for cost of energy (gas)
https://gaspreis.no-panic.org
Apache License 2.0
3 stars 0 forks source link

Adds a settings page #80

Open jschirrmacher opened 1 year ago

jschirrmacher commented 1 year ago

Work in progress: Page can be reached only when using /settings route manually currently, and not yet used by any of the calculations.

mrsimpson commented 1 year ago

🤔

Do you actually have a model / resources at hand to calculate the savings?

mrsimpson commented 1 year ago

I do think we should separate between the inputs for

jschirrmacher commented 1 year ago

🤔

Do you actually have a model / resources at hand to calculate the savings?

Not really, but I hope this data is a good basis for filtering recommendations (like "take a shower only once per week") and a little less raw estimations (shower every day -> shower once per week : reduction of warm water to a third)

jschirrmacher commented 1 year ago

I have a model for shower savings now. Would you have a look @mrsimpson and give some feedback?

One current issue is the amount of energy which is currently used. There is a value in the settings now, but it duplicates the value in the main page. They should somehow be connected with each other (or should be the same, in fact). I would prefer to have the value in the settings and modify that in the main page. WDYT?

mrsimpson commented 1 year ago

Can't look into the model now, but wrt managing state: I do think it made some sense to centralize it (e. G. using Pinia), so that we don't need to always pass props and subscribe to changes just because we move mutations to another component. Wdyt? Or was this not your actual question?

jschirrmacher commented 1 year ago

Not exactly.

Using a store sounds like a good idea. However, this was not my intention here.

Instead I wanted to propose to move the consumption parameter which is located currently in TheConsumptionParameters.vue component into Settings.ts of this branch.

Actually a store might be a solution to access it from the component, but this is not an actual requirement, because reactivity can be used with vue3 simply by using refs, which can be imported from everywhere.

jschirrmacher commented 1 year ago

I think it should now do what we want. @mrsimpson would you mind to have a critical look at this before we merge? I don't want to break something now that we launched our social media campaign.