mfkrause / homebridge-people-pro

Homebridge plugin that provides details of who is in a Home + History (powered by fakegato)
MIT License
41 stars 2 forks source link

Target parameter with multiple values #31

Open hpruszyn opened 2 years ago

hpruszyn commented 2 years ago

It would be great to have many mac addresses in target field, e.g.:

"people": [
                {
                    "name": "Hubert",
                    "target": ["4e:be:71:71:1d:00", "4e:be:71:71:1d:01"],
                    "type": "occupancy"
                },

With that configuration I would be able to check if I'm home with my iPhone and Apple Watch. I think that if any device is present, condition for occupancy should be met. However this can be default configuration and maybe another parameter should be added to define if we want OR or AND between devices.

mfkrause commented 1 year ago

Hey, thanks for the input -- unfortunately I'm currently a little low on availability (as seen by my late reply), but I'd gladly accept any PRs for this if someone wants to implement this.

This should be as easy as adding a few lines to src/accessory.js in order to loop through the target if it's an array.

Otherwise, I'll try to see if I can implement it within the next few weeks.