mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-09-13 15:47:08 +00:00
Fix initial state request
This commit is contained in:
parent
6cee45447d
commit
ba1be7766c
@ -1,6 +1,6 @@
|
||||
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
||||
name: Futurehome
|
||||
version: "0.0.11"
|
||||
version: "0.0.12"
|
||||
slug: futurehome
|
||||
description: Local Futurehome Smarthub integration
|
||||
url: "https://github.com/adrianjagielak/home-assistant-futurehome"
|
||||
|
@ -35,7 +35,8 @@ import { publishDiscovery } from "./discovery";
|
||||
fimp.on("message", (topic, buf) => {
|
||||
try {
|
||||
const msg = JSON.parse(buf.toString());
|
||||
console.debug("Received a FIMP message", topic, msg);
|
||||
console.debug("Received a FIMP message", topic);
|
||||
console.debug(JSON.stringify(msg, null, 0));
|
||||
if (msg.type === "evt.pd7.response") {
|
||||
const devices = msg.val?.param?.devices ?? [];
|
||||
devices.forEach((d: any) => publishDiscovery(ha, d));
|
||||
@ -48,11 +49,17 @@ import { publishDiscovery } from "./discovery";
|
||||
|
||||
// -- ask hub for the device list --------------------------------------
|
||||
fimp.publish("pt:j1/mt:cmd/rt:app/rn:vinculum/ad:1", JSON.stringify({
|
||||
corid: null,
|
||||
ctime: new Date().toISOString(),
|
||||
props: {},
|
||||
resp_to: "pt:j1/mt:rsp/rt:app/rn:ha-futurehome/ad:addon",
|
||||
serv: "vinculum",
|
||||
src: 'smarthome-app',
|
||||
tags: [],
|
||||
type: "cmd.pd7.request",
|
||||
service: "vinculum",
|
||||
uid: uuid(),
|
||||
val_t: "object",
|
||||
val: { cmd: "get", component: "state" },
|
||||
resp_to: "pt:j1/mt:rsp/rt:app/rn:ha-futurehome/ad:addon"
|
||||
val_t: "object",
|
||||
ver: '1',
|
||||
}), { qos: 1 });
|
||||
})();
|
||||
|
Loading…
x
Reference in New Issue
Block a user