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 appwrite integration #134249

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft

Conversation

ParitoshBh
Copy link

@ParitoshBh ParitoshBh commented Dec 30, 2024

Breaking change

Proposed change

Add Appwrite integration.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ParitoshBh

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@ParitoshBh ParitoshBh marked this pull request as ready for review December 31, 2024 00:59
Copy link
Member

@zweckj zweckj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ParitoshBh. Thanks for your contribution! Could you please explain a bit what this integration is, who it would be used by and what popular use-cases could be?

@home-assistant home-assistant bot marked this pull request as draft January 2, 2025 14:06
@home-assistant
Copy link

home-assistant bot commented Jan 2, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@ParitoshBh
Copy link
Author

@zweckj A bit of background on what Appwrite is. It is a self-hostable application that providers built in authentication, database, storage (similar to s3), functions (similar to AWS lambda), messaging and pub/sub style events. Think firebase but self-hosted. Here's the url to their landing page and github repo.

This integration, in its current form, provides a service that can be used to trigger functions in Appwrite (and get response). I have been using it to pull gas prices in to home assistant which are collected from various different sources in a function that resides in Appwrite. Previously, I was using pyscript but that seemed clunky. There might be other similar use-cases.

Moreover, as mentioned above, there are other things like, database, storage, etc. that haven't yet been implemented but could be in future to serve use-cases like transferring home assistant backups to storage provided by Appwrite, etc.

@ParitoshBh ParitoshBh marked this pull request as ready for review January 2, 2025 18:10
@home-assistant home-assistant bot requested a review from zweckj January 2, 2025 18:10
Copy link
Member

@zweckj zweckj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the problem I have with that is, that at this point this is basically just a very generic REST API wrapper. In core, we generally try to be very specific (especially) with services. In general we try to expose as much as possible through entities and only use services, when the entities do not suffice.

So the question for me is: Can we make this more specific? Like, can you identify the objects available in appwrite and expose them through entities? Or for services can we make very specific services? I acknowlege that might be hard, but for a core integration imo we should provide more than a REST wrapper.

@home-assistant home-assistant bot marked this pull request as draft January 3, 2025 10:50
@ParitoshBh
Copy link
Author

So the question for me is: Can we make this more specific? Like, can you identify the objects available in appwrite and expose them through entities? Or for services can we make very specific services?

Yes. There are couple of ways,

  1. Each function can be an entity and when calling service, user can select that entity as target.
  2. Unique service for each function.

I am not quite sure which one is the preferred approach but either way, it is possible to identify what all functions are available.

And appreciate your time and input!

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

Successfully merging this pull request may close these issues.

2 participants