-
Notifications
You must be signed in to change notification settings - Fork 83
Linked Services #104
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
Comments
i have implemented it for my irrigation system which has to be linked to valve services. but it was more hack than proper implementation. |
Ok, thanks. Now it’s working. :) |
cool. will you push your changes to your repository or create PR here? i would love to integrate your changes to my branch. |
PR sent #105 |
@scothi So you have a working Television service? |
Could public void addLinkedService(Service service) be added to the interface Service. I don't see how I can add a linked service when using hap-java. AbstractServiceImpl isn't accessible. I ran into problems when adding FilterMaintenanceAccessory. The service it's linked to can't be added as a linked service now. |
I would like to do this: HomekitAccessory accessory = new MockSwitch(...); |
yes, i have proposed the addLinkedAccessory as well but decided against it in order to be consistent with Characterstics which has addCharacteristics only at AbstractServiceImpl but not in the interface. as of now you can do this but maybe we should really introduce addLinkedService at Service interface. maybe also the addCharacteristic as well. it is more developer friendly imo. |
@gjvanderheiden you are completely right, without adding addLinkedService to Service interface we cannot use it. it was working only with test mock client as i could overwrite getService there. |
I actually thought it could used like this:
Do you see a problem with this approach? You can't link arbitrary services, so type-safety imho would make sense. |
this is the approach @gjvanderheiden was also proposing - dedicated methods. my idea was to keep it more flexible as services can be combined in many different ways and HAP does not restrict it. e.g. you can add battery service to lightbulb or switch and home app shows it correctly. |
Ah, I see. |
Are there any plans to implement the Linked Services logic?
I'm implementing - or at least trying to - the Television service which comes with two linked services (InputSource and TelevisionSpeaker) but I am having difficulties. I tried to add this functionality but it's not clear for me what is linked to what. Is the "sub" service linked to the "main" service or the linked attribute contains the sub service's ids?
The text was updated successfully, but these errors were encountered: