Skip to content

Convert compute functions to TypeScript#2055

Merged
balloob merged 4 commits intohome-assistant:devfrom
iantrich:ts-compute
Nov 18, 2018
Merged

Convert compute functions to TypeScript#2055
balloob merged 4 commits intohome-assistant:devfrom
iantrich:ts-compute

Conversation

@iantrich
Copy link
Copy Markdown
Member

No description provided.

@ghost ghost assigned iantrich Nov 15, 2018
@ghost ghost added the in progress label Nov 15, 2018
import computeDomain from "../../../common/entity/compute_domain";

export default function computeNotifications(states) {
export const computeNotifications = (states: HassEntity[]): string[] => {
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.

states is not a HassEntity[], it's a HassEntities

import computeDomain from "../../../common/entity/compute_domain";

export const computeNotifications = (states: HassEntity[]): string[] => {
export const computeNotifications = (states: HassEntities[]): string[] => {
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.

HassEntities, not HassEntities[]. The [] indicate that it's a list of that type. HassEntities is an object with as keys entity_id and as value the state (it's hass.states)

@balloob balloob merged commit f92f89e into home-assistant:dev Nov 18, 2018
@ghost ghost removed the in progress label Nov 18, 2018
@iantrich iantrich deleted the ts-compute 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.

3 participants