Skip to content

Commit

Permalink
More tuning of the dashboard look.
Browse files Browse the repository at this point in the history
  • Loading branch information
loftux committed May 6, 2021
1 parent 5c996e5 commit 41e0523
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/dashboard/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export class Dashboard {
}

let batteryLevel = this.teslacar.battery.level.toString();
if(this.teslacar.battery.level > this.teslacar.battery.usableLevel) {
// Show usable level, but not if charging due to space constraint
if(this.teslacar.battery.level > this.teslacar.battery.usableLevel && !this.teslacar.battery.charging) {
batteryLevel += '\u200A(\u2744' + this.teslacar.battery.usableLevel +')';
}
batteryLevel += '\u200A/\u200A' + this.teslacar.battery.chargeLimit + '\u200A%';
Expand Down
5 changes: 3 additions & 2 deletions src/dashboard/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@
padding-top: 15px;
padding-bottom: 10px;
padding-left: 10px;
margin-left: 20px;
margin-left: 5px;
margin-top: 5px;
width: 92%;
width: 96%;
float: left;
clear: both;
border-radius: 5px;
box-shadow: 1px 1px 3px rgb(247 175 175 / 50%);
white-space: nowrap;
}
.label {
float: left;
Expand Down
9 changes: 7 additions & 2 deletions src/utils/teslaCar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,17 @@ export class TeslaCar implements ITeslaCar {

public async wakeUp() {
this.skipUpdate = true;
const command = (this.notes === 'Trying To Sleep' ) ? 'wake' : 'wake_up';
return await this.teslafiapi
.action(this.notes === 'Trying To Sleep' ? 'wake' : 'wake_up', '')
.action(command, '')
.then(async (response) => {
if (response.response && response.response.result) {
this.isOnline = true;

if(command === 'wake_up') {
setTimeout(() => {
this.teslafiapi.action('wake','');
}, 20000);
}
return true;
} else {
// Not changing car state, we do not know the actual state, let polling find out.
Expand Down

0 comments on commit 41e0523

Please sign in to comment.