Add Edit Sheet service to Google Sheets#79149
Conversation
chishm
left a comment
There was a problem hiding this comment.
Apart from some suggested static type changes, this looks good to me.
I'm not sure what's going on with the code coverage, it seems to be flagging files in homeassistant/components/recorder, which are not touched by this PR.
|
|
||
| DOMAIN = "google_sheets" | ||
|
|
||
| CONF_SHEETS_ACCESS = "sheets_access" |
There was a problem hiding this comment.
Can you please make this a Final constant?
| """Return the desired sheets feature access.""" | ||
| return [ | ||
| FeatureAccess.file.value, | ||
| FeatureAccess[config_entry.options[CONF_SHEETS_ACCESS]].value, |
There was a problem hiding this comment.
Can you help me understand in more detail how the read and write scopes will be used? I get the general idea of read vs write scopes, but I don't quite get how these will be used compare to the file scope.
The way it appears right now is that I see is the user will create a single sheet (using the file scope) -- but it's also given a read-only scope for everything in the account. I don't see a way to access the other sheets or why giving broad read/write access can even be used.
There was a problem hiding this comment.
The read scope gives read access to all spreadsheets. The file scope ensures users still have write access to the document that the integration created. I plan on extending the append service to allow the user to add a document id so they can specify a different document other than the integration made one.
The plan is to add an edit service which makes more sense for any other documents that people have access to that they want to modify. It should be the same schema for both services.
There was a problem hiding this comment.
Yeah I understand the scope differences, just wanting to see how they connect to the feature to ensure they all make sense together.
Ok, I'd say let's do the scope changes with the features it will enable? I don't mind viewing the larger PR. I just want to make sure it all connects.
allenporter
left a comment
There was a problem hiding this comment.
I'm a bit confused about the options screen. The default value is it creates its own sheet and allows you to have read/write access to it. But if you open this up, you can only choose read or write access. Is there an option missing here with the default value of read/write to the default sheet?
Maybe it would be worth updating the help documentation to explain how this works as a reply -- since right now it also doesn't really talk about the default sheet.
…into google_sheets_options
|
Because there hasn't been any activity on this PR for quite some time now, I've decided to close it for being stale. Feel free to re-open this PR when you are ready to pick up work on it again 👍 |
Breaking change
Proposed change
Add Edit Sheet service to Google Sheets
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: