-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert hui-climate-entity-row to TypeScript/LitElement #1899
Conversation
if ( | ||
!this._config || | ||
!this._config.entity || | ||
!this.hass!.states[this._config.entity] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should only chekc for !this.hass
here. Don't check if entity exist in states as that is already handled by <hui-generic-entity-row>
} | ||
|
||
protected render(): TemplateResult { | ||
if (!this.hass) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to check for config existing too?
> | ||
<ha-climate-state | ||
.hass=${this.hass} | ||
.stateObj=${this.hass!.states[this._config!.entity]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that you need an !
here is a good indicator that you need to check above if it exists.
No description provided.