Skip to content

Commit

Permalink
Update prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed Jan 27, 2019
1 parent d7f6f32 commit 511a81c
Show file tree
Hide file tree
Showing 58 changed files with 969 additions and 1,211 deletions.
3 changes: 2 additions & 1 deletion .eslintrc-hound.json
Expand Up @@ -8,7 +8,8 @@
},
"settings": {
"react": {
"pragma": "h"
"pragma": "h",
"version": "15.0"
},
"import/resolver": {
"webpack": {
Expand Down
38 changes: 18 additions & 20 deletions demo/src/custom-cards/ha-demo-card.ts
Expand Up @@ -54,26 +54,24 @@ export class HADemoCard extends LitElement implements LovelaceCard {
.disabled=${this._switching}
></paper-icon-button>
<div>
${
this._switching
? html`
<paper-spinner-lite active></paper-spinner-lite>
`
: until(
selectedDemoConfig.then(
(conf) => html`
${conf.name}
<small>
by
<a target="_blank" href="${conf.authorUrl}">
${conf.authorName}
</a>
</small>
`
),
""
)
}
${this._switching
? html`
<paper-spinner-lite active></paper-spinner-lite>
`
: until(
selectedDemoConfig.then(
(conf) => html`
${conf.name}
<small>
by
<a target="_blank" href="${conf.authorUrl}">
${conf.authorName}
</a>
</small>
`
),
""
)}
</div>
<paper-icon-button
@click=${this._nextConfig}
Expand Down
32 changes: 15 additions & 17 deletions gallery/src/demos/demo-util-long-press.ts
Expand Up @@ -8,25 +8,23 @@ export class DemoUtilLongPress extends LitElement {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
${
[1, 2, 3].map(
() => html`
<ha-card>
<paper-button
@ha-click="${this._handleTap}"
@ha-hold="${this._handleHold}"
.longPress="${longPress()}"
>
(long) press me!
</paper-button>
${[1, 2, 3].map(
() => html`
<ha-card>
<paper-button
@ha-click="${this._handleTap}"
@ha-hold="${this._handleHold}"
.longPress="${longPress()}"
>
(long) press me!
</paper-button>
<textarea></textarea>
<textarea></textarea>
<div>(try pressing and scrolling too!)</div>
</ha-card>
`
)
}
<div>(try pressing and scrolling too!)</div>
</ha-card>
`
)}
`;
}

Expand Down
34 changes: 15 additions & 19 deletions src/auth/ha-authorize.ts
Expand Up @@ -78,13 +78,11 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
return html`
${this.renderStyle()}
<p>
${
this.localize(
"ui.panel.page-authorize.authorizing_client",
"clientId",
this.clientId
)
}
${this.localize(
"ui.panel.page-authorize.authorizing_client",
"clientId",
this.clientId
)}
</p>
${loggingInWith}
Expand All @@ -97,18 +95,16 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
.step="{{step}}"
></ha-auth-flow>
${
inactiveProviders.length > 0
? html`
<ha-pick-auth-provider
.resources="${this.resources}"
.clientId="${this.clientId}"
.authProviders="${inactiveProviders}"
@pick="${this._handleAuthProviderPick}"
></ha-pick-auth-provider>
`
: ""
}
${inactiveProviders.length > 0
? html`
<ha-pick-auth-provider
.resources="${this.resources}"
.clientId="${this.clientId}"
.authProviders="${inactiveProviders}"
@pick="${this._handleAuthProviderPick}"
></ha-pick-auth-provider>
`
: ""}
`;
}

Expand Down
11 changes: 4 additions & 7 deletions src/components/entity/ha-state-label-badge.ts
Expand Up @@ -56,13 +56,10 @@ export class HaStateLabelBadge extends hassLocalizeLitMixin(LitElement) {
return html`
${this.renderStyle()}
<ha-label-badge
class="${
classMap({
[domain]: true,
"has-unit_of_measurement":
"unit_of_measurement" in state.attributes,
})
}"
class="${classMap({
[domain]: true,
"has-unit_of_measurement": "unit_of_measurement" in state.attributes,
})}"
.value="${this._computeValue(domain, state)}"
.icon="${this._computeIcon(domain, state)}"
.image="${state.attributes.entity_picture}"
Expand Down
67 changes: 29 additions & 38 deletions src/components/ha-label-badge.ts
Expand Up @@ -32,49 +32,40 @@ class HaLabelBadge extends LitElement {
<div class="badge-container">
<div class="label-badge" id="badge">
<div
class="${
classMap({
value: true,
big: Boolean(this.value && this.value.length > 4),
})
}"
class="${classMap({
value: true,
big: Boolean(this.value && this.value.length > 4),
})}"
>
${
this.icon && !this.value && !this.image
? html`
<ha-icon .icon="${this.icon}"></ha-icon>
`
: ""
}
${
this.value && !this.image
? html`
<span>${this.value}</span>
`
: ""
}
</div>
${
this.label
${this.icon && !this.value && !this.image
? html`
<div
class="${
classMap({ label: true, big: this.label.length > 5 })
}"
>
<span>${this.label}</span>
</div>
<ha-icon .icon="${this.icon}"></ha-icon>
`
: ""
}
</div>
${
this.description
: ""}
${this.value && !this.image
? html`
<span>${this.value}</span>
`
: ""}
</div>
${this.label
? html`
<div class="title">${this.description}</div>
<div
class="${classMap({
label: true,
big: this.label.length > 5,
})}"
>
<span>${this.label}</span>
</div>
`
: ""
}
: ""}
</div>
${this.description
? html`
<div class="title">${this.description}</div>
`
: ""}
</div>
`;
}
Expand Down
22 changes: 10 additions & 12 deletions src/panels/config/cloud/cloud-alexa-pref.ts
Expand Up @@ -62,18 +62,16 @@ export class CloudAlexaPref extends LitElement {
>This integration requires an Alexa-enabled device like the Amazon
Echo.</em
>
${
enabled
? html`
<p>Exposed entities:</p>
<cloud-exposed-entities
.hass="${this.hass}"
.filter="${this.cloudStatus!.alexa_entities}"
.supportedDomains="${this.cloudStatus!.alexa_domains}"
></cloud-exposed-entities>
`
: ""
}
${enabled
? html`
<p>Exposed entities:</p>
<cloud-exposed-entities
.hass="${this.hass}"
.filter="${this.cloudStatus!.alexa_entities}"
.supportedDomains="${this.cloudStatus!.alexa_domains}"
></cloud-exposed-entities>
`
: ""}
</div>
</paper-card>
`;
Expand Down
28 changes: 13 additions & 15 deletions src/panels/config/cloud/cloud-exposed-entities.ts
Expand Up @@ -51,21 +51,19 @@ export class CloudExposedEntities extends LitElement {

return html`
${this.renderStyle()}
${
repeat(
states!,
(stateInfo) => stateInfo[1].entity_id,
(stateInfo) => html`
<span>
<ha-state-icon
.stateObj="${stateInfo[1]}"
@click="${this._handleMoreInfo}"
></ha-state-icon>
<paper-tooltip position="bottom">${stateInfo[0]}</paper-tooltip>
</span>
`
)
}
${repeat(
states!,
(stateInfo) => stateInfo[1].entity_id,
(stateInfo) => html`
<span>
<ha-state-icon
.stateObj="${stateInfo[1]}"
@click="${this._handleMoreInfo}"
></ha-state-icon>
<paper-tooltip position="bottom">${stateInfo[0]}</paper-tooltip>
</span>
`
)}
`;
}

Expand Down
38 changes: 18 additions & 20 deletions src/panels/config/cloud/cloud-google-pref.ts
Expand Up @@ -69,26 +69,24 @@ export class CloudGooglePref extends LitElement {
>This integration requires a Google Assistant-enabled device like
the Google Home or Android phone.</em
>
${
google_enabled
? html`
<div class="unlock">
<div>Allow unlocking locks</div>
<paper-toggle-button
id="google_allow_unlock"
.checked="${google_allow_unlock}"
@change="${this._toggleChanged}"
></paper-toggle-button>
</div>
<p>Exposed entities:</p>
<cloud-exposed-entities
.hass="${this.hass}"
.filter="${this.cloudStatus!.google_entities}"
.supportedDomains="${this.cloudStatus!.google_domains}"
></cloud-exposed-entities>
`
: ""
}
${google_enabled
? html`
<div class="unlock">
<div>Allow unlocking locks</div>
<paper-toggle-button
id="google_allow_unlock"
.checked="${google_allow_unlock}"
@change="${this._toggleChanged}"
></paper-toggle-button>
</div>
<p>Exposed entities:</p>
<cloud-exposed-entities
.hass="${this.hass}"
.filter="${this.cloudStatus!.google_entities}"
.supportedDomains="${this.cloudStatus!.google_domains}"
></cloud-exposed-entities>
`
: ""}
</div>
<div class="card-actions">
<ha-call-api-button
Expand Down

0 comments on commit 511a81c

Please sign in to comment.