Skip to content

Convert toggle functions to TypeScript#2054

Closed
iantrich wants to merge 3 commits intohome-assistant:devfrom
iantrich:ts-turn-on-off
Closed

Convert toggle functions to TypeScript#2054
iantrich wants to merge 3 commits intohome-assistant:devfrom
iantrich:ts-turn-on-off

Conversation

@iantrich
Copy link
Copy Markdown
Member

Note: These changes are not really "testable" until we resolve the longPress directive issue that was introduced with the upgrading of lit-html

@ghost ghost assigned iantrich Nov 15, 2018
@ghost ghost added the in progress label Nov 15, 2018
@@ -17,4 +22,4 @@ export default function turnOnOffEntity(hass, entityId, turnOn = true) {
}

hass.callService(serviceDomain, service, { entity_id: entityId });
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we should return this promise so we can await until command is completed.


export const toggleEntity = (hass: HomeAssistant, entityId: string): void => {
const turnOn = STATES_OFF.includes(hass.states[entityId].state);
turnOnOffEntity(hass, entityId, turnOn);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's return this.

* @appliesMixin LocalizeMixin
* @appliesMixin NavigateMixin
*/
class HuiPictureGlanceCard extends NavigateMixin(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rebase gone wrong?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

shoot!

@iantrich
Copy link
Copy Markdown
Member Author

I don't have time right now to resolve this merge conflict. Will take a look tonight, hopefully.

@iantrich iantrich closed this Nov 22, 2018
@ghost ghost removed the in progress label Nov 22, 2018
@iantrich iantrich deleted the ts-turn-on-off branch December 8, 2018 06:13
@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.

4 participants