mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 13:56:35 +00:00
Adding Type to Returns
This commit is contained in:
parent
bb4ce278b0
commit
1fcf510278
@ -13,6 +13,7 @@ import { HomeAssistant, LightEntity } from "../../../types.js";
|
|||||||
import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin";
|
import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin";
|
||||||
import { LovelaceCard, LovelaceConfig } from "../types.js";
|
import { LovelaceCard, LovelaceConfig } from "../types.js";
|
||||||
import { longPress } from "../common/directives/long-press-directive";
|
import { longPress } from "../common/directives/long-press-directive";
|
||||||
|
import { TemplateResult } from "lit-html";
|
||||||
|
|
||||||
const lightConfig = {
|
const lightConfig = {
|
||||||
radius: 80,
|
radius: 80,
|
||||||
@ -138,7 +139,7 @@ export class HuiLightCard extends hassLocalizeLitMixin(LitElement)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderStyle() {
|
private renderStyle(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
${roundSliderStyle}
|
${roundSliderStyle}
|
||||||
<style>
|
<style>
|
||||||
@ -268,7 +269,7 @@ export class HuiLightCard extends hassLocalizeLitMixin(LitElement)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeBrightness(stateObj: LightEntity) {
|
private _computeBrightness(stateObj: LightEntity): string {
|
||||||
if (!stateObj.attributes.brightness) {
|
if (!stateObj.attributes.brightness) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@ -276,7 +277,7 @@ export class HuiLightCard extends hassLocalizeLitMixin(LitElement)
|
|||||||
return `brightness(${(brightness + 245) / 5}%)`;
|
return `brightness(${(brightness + 245) / 5}%)`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeColor(stateObj: LightEntity) {
|
private _computeColor(stateObj: LightEntity): string {
|
||||||
if (!stateObj.attributes.hs_color) {
|
if (!stateObj.attributes.hs_color) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user