import { Connection } from "./connection.js" ; import * as messages from "./messages.js" ; import { HassEntity , HassServices , HassConfig , HassUser , HassServiceTarget , } from "./types.js" ; export const getStates = ( connection ) => connection . sendMessagePromise < HassEntity [ ] > ( messages . states ( ) ) ; export const getServices = ( connection ) => connection . sendMessagePromise < HassServices > ( messages . services ( ) ) ; export const getConfig = ( connection ) => connection . sendMessagePromise < HassConfig > ( messages . config ( ) ) ; export const getUser = ( connection ) => connection . sendMessagePromise < HassUser > ( messages . user ( ) ) ; export const callService = ( connection , domain , service , serviceData ? , target ? ) => connection . sendMessagePromise ( messages . callService ( domain , service , serviceData , target ) ) ;