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

Add window support (?) #766

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gdyr
Copy link

@gdyr gdyr commented Aug 12, 2021

Added support for the "Window" accessory type - so that the Shelly 2.5 can present window actuators such as these to HomeKit as windows (but essentially just run in roller shutter mode).

No worries if you'd prefer not to implement it (or would prefer to do it a different way) but feel free to merge if it's of use!

I've pretty much taken the path of least resistance:

  • Add a 5th system mode "Window"
  • Add a 12th component type "kWindow"
  • Add "w_avail" indication in the GetInfoExt JSON, though this is just fed by the same MGOS_SYS_CONFIG_HAVE_WC1
  • Add shelly_hap_window.cpp and shelly_hap_window.hpp (copies of the window_covering files, but referencing kHAPServiceType_Window)
  • Add new IID's and AID in shelly_common (still not sure what these are for, exactly)

Seems to work for me in HomeKit, though I don't have the actuator yet!

@timoschilling
Copy link
Collaborator

Please run make format and commit the result

@gdyr
Copy link
Author

gdyr commented Aug 12, 2021

Done! Sorry about that

@rojer
Copy link
Contributor

rojer commented Aug 12, 2021

hi @gdyr , thank you for taking the time to do it.
i would like to first understand what is the practical difference, from the homekit standpoint, in having a Window vs Window Covering? just aesthetics, different tile?

second, if we are going to do it, we are definitely not going to do it by wholesale copy/paste of WindowCovering. we'll need to pull out common base and share bulk of the code.

@gdyr
Copy link
Author

gdyr commented Aug 12, 2021

It is just the presentation of the tile, yep! Though this affects other things, e.g. if we ask Siri to “open the blinds” then that wouldn’t apply to a window but would apply to a window covering.

In our house we have both, so don’t want to open the window when we just want to open the blinds!

Happy to revise to deduplicate code.
What would your suggested approach be for doing so, in broad terms?

@rojer
Copy link
Contributor

rojer commented Aug 13, 2021

if it's just about the service type, then it may not even be necessary to create a separate mode. keep the roller-shutter mode, make HAP type a config parameter of shelly::hap::WindowCovering, and just use different constants at construction time.

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.

None yet

3 participants