Skip to content
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

Picture Glance Conversion to TS #2029

Merged
merged 5 commits into from
Nov 20, 2018
Merged

Picture Glance Conversion to TS #2029

merged 5 commits into from
Nov 20, 2018

Conversation

zsarnett
Copy link
Contributor

@zsarnett zsarnett commented Nov 9, 2018

Convert to TS

@ghost ghost assigned zsarnett Nov 9, 2018
@ghost ghost added the in progress label Nov 9, 2018
@balloob
Copy link
Member

balloob commented Nov 9, 2018

Please do the conversion in a separate PR.

@balloob
Copy link
Member

balloob commented Nov 9, 2018

I would also expect the title ("Living Room") to be vertically centered in the overlay, not baseline aligned with the icons.

@zsarnett zsarnett changed the title Picture Glance Conversion to TS and Add State Display to Dialog Entities Picture Glance Conversion to TS Nov 9, 2018
class="${
classMap({
"state-on": !STATES_OFF.has(
this.hass!.states[entityConf.entity].state
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be undefined.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be easier to extract the render logic for each entity into a function so you can do checks if state obj exists etc.

const stateObj = this.hass.states[entityConf.entity];

if (!stateObj) {
return html``;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should render an error if this occurs as this means we have an invalid entity defined, correct? We should highlight that this entity is invalid in that case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. We did in the previous version, doesn't mean we shouldn't. I look into a yellow box and see what it looks like

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is the pace is so tiny... Hard to give a good error

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about a yellow box wrapped in a <paper-tooltip> to show the warning when hovered?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<div>
<ha-icon icon="hass:alert"></ha-icon></paper-tooltip>
<paper-tooltip>Unable to find ${entityConf.entity}</paper-tooltip>
</div>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, I am fine with sticking to the same logic as the element we're converting, and adding new logic in a future PR.

return;
}

if (this._config!.camera_image) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be else if ? Otherwise we'll navigate AND open more info ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well there is a return statement in the above but I converted to else if

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh my bad, didn't see.

@balloob balloob merged commit ef2aa2e into dev Nov 20, 2018
@ghost ghost removed the in progress label Nov 20, 2018
@balloob balloob deleted the picture-glance-upgrade branch November 20, 2018 11:24
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants