Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to read AccessoryInformation #102

Open
max3232rs opened this issue Apr 22, 2020 · 0 comments
Open

how to read AccessoryInformation #102

max3232rs opened this issue Apr 22, 2020 · 0 comments

Comments

@max3232rs
Copy link

Hi, I'm new here, but use this plugin with my node-red for a while. Thanks a lot.
I searched for a solution to keep this plugin in sync with my node-red without saving the state, because this "wanted" sync state might be wrong or get lost. So I use hb/to/get with {"name":"*"} to inventory the bridge. Therefor I stored some technical date like a device id in the so called ServiceLabel, because I don't want this in the display name. This works great, till I restart the homebridge. The Name property gets lost. You have to fetch it individually per service via hb/to/get/characteristic - very poor.
My best idea was to store this in the AccessoryInformation. A device id is quite like a serial number. But I never found a way to retrieve this set information back.

Perhaps I haven't got the documention right, but I decided to go the hard way and patched the controller.js.

As you added the _props feature, I've had the problem to combine the props switch and my info switch. So I deviced to move it to an own property. Now I can do a
{
"name": "
",
"info" : 1,
"props" : 1
}
to hb/to/get either for * or a specific service and retrieve the information I need.
It's also compatible to *_props".

The diff.patch is attached. I would like to hear your mind.
controller.patch.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant