Skip to content

Commit

Permalink
Improve layout (#27)
Browse files Browse the repository at this point in the history
Fix layout and translation
  • Loading branch information
MelleD authored Jan 31, 2024
1 parent 1319af2 commit 8162604
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"very_high": "Very High",
"extreme": "Extreme"
},
"pm_recommendation_levels": {
"pm_risk": {
"low": "No risk",
"moderate": "Moderate for breathing problems",
"moderate": "Moderate breathing problems",
"high": "High for breathing problems",
"very_high": "High for the lungs and head",
"extreme": "Extreme for the lungs and head"
"very_high": "High for lungs and head",
"extreme": "Extreme for lungs and head"
}
}
17 changes: 9 additions & 8 deletions src/pm-index-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class PMIndexCard extends LitElement {

if (stateValue >= 12 && stateValue < 35) {
pmRiskStr = 'pm_levels.moderate'
pmRisk = 'pm_recommendation_levels.moderate'
pmRisk = 'pm_risk.moderate'
colorTriangleValue = 3;

if (stateValue >= 21) {
Expand All @@ -123,7 +123,7 @@ export class PMIndexCard extends LitElement {

if (stateValue >= 35 && stateValue < 55) {
pmRiskStr = 'pm_levels.high'
pmRisk = 'pm_recommendation_levels.high'
pmRisk = 'pm_risk.high'
colorTriangleValue = 6;

if (stateValue >= 45) {
Expand All @@ -134,7 +134,7 @@ export class PMIndexCard extends LitElement {

if (stateValue >= 55 && stateValue < 150) {
pmRiskStr = 'pm_levels.very_high'
pmRisk = 'pm_recommendation_levels.very_high'
pmRisk = 'pm_risk.very_high'

colorTriangleValue = 8;

Expand All @@ -149,7 +149,7 @@ export class PMIndexCard extends LitElement {

if (stateValue >= 150) {
pmRiskStr = 'pm_levels.extreme'
pmRisk = 'pm_recommendation_levels.extreme'
pmRisk = 'pm_risk.extreme'
colorTriangleValue = 11;

if (stateValue >= 250) {
Expand Down Expand Up @@ -211,10 +211,11 @@ export class PMIndexCard extends LitElement {
</p>
</div>
<div>
<p>
<span style="font-weight: bold;">${localize('common.pm_risk', '', '', this.config.language)}</span><br/>
<SMALL>${localize(pmRisk, '', '', this.config.language)}</SMALL>
</p>
<p>
<span style="font-weight: bold;">${localize('common.pm_risk', '', '', this.config.language)}</span><br/>
<SMALL>${localize(pmRisk, '', '', this.config.language)}</SMALL>
</p>
</div>
</div>
</div>
</ha-card>
Expand Down

0 comments on commit 8162604

Please sign in to comment.