home-assistant-js-websocket
Advanced tools
Comparing version 5.2.2 to 5.2.3
import { HassConfig, UnsubscribeFunc } from "./types.js"; | ||
import { Connection } from "./connection.js"; | ||
export declare const configColl: (conn: Connection) => import("./collection.js").Collection<HassConfig>; | ||
export declare const subscribeConfig: (conn: Connection, onChange: (state: HassConfig) => void) => UnsubscribeFunc; | ||
@@ -4,0 +5,0 @@ export declare const STATE_NOT_RUNNING = "NOT_RUNNING"; |
@@ -15,3 +15,3 @@ import { getCollection } from "./collection.js"; | ||
]).then((unsubs) => () => unsubs.forEach((unsub) => unsub())); | ||
const configColl = (conn) => getCollection(conn, "_cnf", fetchConfig, subscribeUpdates); | ||
export const configColl = (conn) => getCollection(conn, "_cnf", fetchConfig, subscribeUpdates); | ||
export const subscribeConfig = (conn, onChange) => configColl(conn).subscribe(onChange); | ||
@@ -18,0 +18,0 @@ export const STATE_NOT_RUNNING = "NOT_RUNNING"; |
@@ -734,3 +734,3 @@ (function (global, factory) { | ||
const domainInfo = Object.assign({}, state[domain], { | ||
[service]: { description: "", fields: {} } | ||
[service]: { description: "", fields: {} }, | ||
}); | ||
@@ -747,3 +747,3 @@ return { [domain]: domainInfo }; | ||
const domainInfo = {}; | ||
Object.keys(curDomainInfo).forEach(sKey => { | ||
Object.keys(curDomainInfo).forEach((sKey) => { | ||
if (sKey !== service) | ||
@@ -757,4 +757,4 @@ domainInfo[sKey] = curDomainInfo[sKey]; | ||
conn.subscribeEvents(store.action(processServiceRegistered), "service_registered"), | ||
conn.subscribeEvents(store.action(processServiceRemoved), "service_removed") | ||
]).then(unsubs => () => unsubs.forEach(fn => fn())); | ||
conn.subscribeEvents(store.action(processServiceRemoved), "service_removed"), | ||
]).then((unsubs) => () => unsubs.forEach((fn) => fn())); | ||
const servicesColl = (conn) => getCollection(conn, "_srv", fetchServices, subscribeUpdates$1); | ||
@@ -814,2 +814,3 @@ const subscribeServices = (conn, onChange) => servicesColl(conn).subscribe(onChange); | ||
exports.callService = callService$1; | ||
exports.configColl = configColl; | ||
exports.createCollection = createCollection; | ||
@@ -828,2 +829,3 @@ exports.createConnection = createConnection; | ||
exports.getUser = getUser; | ||
exports.servicesColl = servicesColl; | ||
exports.subscribeConfig = subscribeConfig; | ||
@@ -830,0 +832,0 @@ exports.subscribeEntities = subscribeEntities; |
import { HassServices, UnsubscribeFunc } from "./types.js"; | ||
import { Connection } from "./connection.js"; | ||
export declare const servicesColl: (conn: Connection) => import("./collection.js").Collection<HassServices>; | ||
export declare const subscribeServices: (conn: Connection, onChange: (state: HassServices) => void) => UnsubscribeFunc; |
@@ -8,3 +8,3 @@ import { getCollection } from "./collection.js"; | ||
const domainInfo = Object.assign({}, state[domain], { | ||
[service]: { description: "", fields: {} } | ||
[service]: { description: "", fields: {} }, | ||
}); | ||
@@ -21,3 +21,3 @@ return { [domain]: domainInfo }; | ||
const domainInfo = {}; | ||
Object.keys(curDomainInfo).forEach(sKey => { | ||
Object.keys(curDomainInfo).forEach((sKey) => { | ||
if (sKey !== service) | ||
@@ -31,5 +31,5 @@ domainInfo[sKey] = curDomainInfo[sKey]; | ||
conn.subscribeEvents(store.action(processServiceRegistered), "service_registered"), | ||
conn.subscribeEvents(store.action(processServiceRemoved), "service_removed") | ||
]).then(unsubs => () => unsubs.forEach(fn => fn())); | ||
const servicesColl = (conn) => getCollection(conn, "_srv", fetchServices, subscribeUpdates); | ||
conn.subscribeEvents(store.action(processServiceRemoved), "service_removed"), | ||
]).then((unsubs) => () => unsubs.forEach((fn) => fn())); | ||
export const servicesColl = (conn) => getCollection(conn, "_srv", fetchServices, subscribeUpdates); | ||
export const subscribeServices = (conn, onChange) => servicesColl(conn).subscribe(onChange); |
@@ -5,3 +5,3 @@ { | ||
"sideEffects": false, | ||
"version": "5.2.2", | ||
"version": "5.2.3", | ||
"description": "Home Assistant websocket client", | ||
@@ -8,0 +8,0 @@ "source": "lib/index.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105653
1967