Skip to content

Convert call-service to TypeScript#1985

Merged
balloob merged 3 commits intohome-assistant:devfrom
iantrich:ts-common-functions
Nov 7, 2018
Merged

Convert call-service to TypeScript#1985
balloob merged 3 commits intohome-assistant:devfrom
iantrich:ts-common-functions

Conversation

@iantrich
Copy link
Copy Markdown
Member

@iantrich iantrich commented Nov 5, 2018

I'm not sure what type I should use for the config parameter

@ghost ghost assigned iantrich Nov 5, 2018
@ghost ghost added the in progress label Nov 5, 2018
@@ -0,0 +1,8 @@
import { HomeAssistant } from "../../../types";

export const callService = (config: any, hass: HomeAssistant): void => {
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.

The call is indeed a bit weird, but you can derive from the usage of this object what we expect:

interface CallServiceConfig {
  service: string;
  entity: string;
  service_data?: { [key: string]: any };
}

@iantrich iantrich force-pushed the ts-common-functions branch from 8521714 to 3367680 Compare November 7, 2018 03:02
@balloob balloob merged commit f971995 into home-assistant:dev Nov 7, 2018
@ghost ghost removed the in progress label Nov 7, 2018
@iantrich iantrich deleted the ts-common-functions branch November 16, 2018 19:17
@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