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

adding support for whitelisting homes #84

Merged
merged 3 commits into from
Nov 16, 2022
Merged

Conversation

JulianLepinski
Copy link

Hey @0x5e — I've just created a quick PR which adds support for whitelisting a single home based on the home's ID number. If the options.homeWhitelist key is unconfigured it includes all homes and devices as previously, but if configured it ignores all but the whitelisted home.

I've also added it to the config.schema.json so it's configurable through the settings dialog in homebridge-config-ui-x. Hopefully this is useful to you! If there are any changes you'd like me to make, please let me know. 🙂

@0x5e
Copy link
Owner

0x5e commented Nov 16, 2022

Hi @JulianLepinski thanks for the PR! I was planing to do this feature in 1.7.0.
The code is good, however there's one thing I'm not sure, should we support filtering multiple homes? It can brings the max compatibility if anyone needs. That do you think about it?

@JulianLepinski
Copy link
Author

JulianLepinski commented Nov 16, 2022

Hey @0x5e — yeah, I had the same thought. I'd considered allowing the whitelist to be an array, but I'm not very familiar with the config.schema.json functionality and it wasn't immediately obvious to me how to do that. I do think you're right that it would make the system more flexible, so it's probably worthwhile.

Let me take a look at how that could be implemented.

@0x5e
Copy link
Owner

0x5e commented Nov 16, 2022

Here's some documents about homebridge config schema, and online form validation playground,
https://developers.homebridge.io/#/config-schema#arrays
https://hamidihamza.com/ajsf/?framework=bootstrap-4

@JulianLepinski
Copy link
Author

Okay, I believe I've converted this over now to use an array of whitelisted homes IDs instead of a single whitelisted ID. Let me know how it looks.

@0x5e 0x5e merged commit 6b3a48f into 0x5e:develop Nov 16, 2022
@0x5e
Copy link
Owner

0x5e commented Nov 16, 2022

It works on me, I've add the conditions when project type is 2. Thanks @JulianLepinski again!

@JulianLepinski
Copy link
Author

Awesome, happy to help! 🙂

@0x5e 0x5e added this to the 1.6.0 milestone Nov 17, 2022
@moshed
Copy link

moshed commented Dec 13, 2022

how would I get the value of my home id?

@0x5e
Copy link
Owner

0x5e commented Dec 13, 2022

how would I get the value of my home id?

It can be found from the log.

@moshed
Copy link

moshed commented Dec 13, 2022

found it thanks!

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

Successfully merging this pull request may close these issues.

3 participants