Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for megawatt #15818

Merged
merged 27 commits into from
Sep 4, 2024
Merged

Add support for megawatt #15818

merged 27 commits into from
Sep 4, 2024

Conversation

Maschga
Copy link
Contributor

@Maschga Maschga commented Aug 30, 2024

Hi,
this PR adds support for the unit megawatt and its display on the screen.
If support for gigawatt is wanted I can add this, too.

I also changed the tests to work with the new enum.

I was unsure how I should export the enum.
If the current solution is not correct, please let me know so that I can learn from it and improve it.

Also, I was unsure if I should rename this function:

powerInKw(newVal, oldVal) {
	// force update if unit changes but not the value
	if (newVal !== oldVal) {
		this.$refs.powerNumber.forceUpdate();
	}
}

Fixes #15290

Thank you very much for this great project!
~ Maschga

@Maschga Maschga marked this pull request as draft August 30, 2024 15:12
@naltatis naltatis self-assigned this Aug 30, 2024
@naltatis naltatis added enhancement New feature or request ux User experience/ interface labels Aug 30, 2024
@Maschga Maschga marked this pull request as ready for review August 30, 2024 19:52
@naltatis
Copy link
Member

👍 Looks really good. You've picked a first issue that touches a lot of different parts of the UI :D
I did a quick scan through your changes and left comments. I'll give it a more in dept look and try and test different scenarios at a later time.

Copy link
Member

@naltatis naltatis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. We can merge once the last comments are done (and the tests are green).

Maschga and others added 2 commits September 3, 2024 08:49
use `kw`-unit for 0 watt if `format` is specified as `AUTO`
use 1 digit for 0 watt if `digits` is specified as `undefined`
@naltatis naltatis merged commit 536712d into evcc-io:master Sep 4, 2024
6 checks passed
@naltatis
Copy link
Member

naltatis commented Sep 4, 2024

Thanks! 🙌

@Maschga Maschga deleted the shorten-numbers-by-using-larger-units branch September 10, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ux User experience/ interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Anzeigeerweiterung für Megawatt
3 participants