Skip to content

Commit

Permalink
Fix translations. Fix #138
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Mar 3, 2021
1 parent fcbff9e commit 0e8a6a9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions slider-entity-row.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/controllers/climate-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export class ClimateController extends Controller {
}

get string() {
if (this.stateObj.attributes.hvac_mode === "off")
return this._hass.localize("state.climate.off");
return `${this.value} ${this._hass.config.unit_system.temperature}`;
}

Expand Down
4 changes: 3 additions & 1 deletion src/controllers/cover-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export class CoverController extends Controller {
switch (this.attribute) {
case "position":
if (this.stateObj.state === "closed")
return this._hass.localize("state.cover.closed");
return this._hass.localize("component.cover.state._.closed");
if (this.value === 100)
return this._hass.localize("component.cover.state._.open");
return `${this.value} %`;
case "tilt":
return this.value;
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/fan-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class FanController extends Controller {

get string() {
if (this.stateObj.state === "off")
return this._hass.localize("state.default.off");
return this._hass.localize("component.fan.state._.off");
return this.stateObj.attributes.speed;
}

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/light-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class LightController extends Controller {

get string() {
if (this.stateObj && this.stateObj.state === "off")
return this._hass.localize("state.default.off");
return this._hass.localize("component.light.state._.off");
switch (this.attribute) {
case "color_temp":
case "brightness":
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/media-player-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class MediaPlayerController extends Controller {
if (this.stateObj.attributes.is_volume_muted) return "-";
return !!this.stateObj.attributes.volume_level
? `${this.value} %`
: this._hass.localize("state.media_player.off");
: this._hass.localize("component.media_player.state._.off");
}

get hasToggle() {
Expand Down

0 comments on commit 0e8a6a9

Please sign in to comment.