Skip to content

Commit

Permalink
Use ghome-foyer-api package (#337)
Browse files Browse the repository at this point in the history
* Use ghome-foyer-api package

* Update CONTRIBUTING.md
  • Loading branch information
KapJI authored Feb 28, 2023
1 parent 1bc5049 commit 80c5587
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 8,504 deletions.
15 changes: 0 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,3 @@ You can also run the tests on all repository files manually with this command:
```console
$ poetry run pre-commit run --all-files
```

## Compiling proto file

`v1.proto` is compiled with these commands from the repo root:

```console
$ poetry install
$ cd glocaltokens
$ poetry run python -m grpc_tools.protoc --proto_path=. --python_out=. google/internal/home/foyer/v1.proto
$ cd ..
$ poetry run python -m grpc_tools.protoc --proto_path=. --grpc_python_out=. --mypy_out=readable_stubs:. --mypy_grpc_out=readable_stubs:. glocaltokens/google/internal/home/foyer/v1.proto
$ git commit -am "Update generated files"
$ pre-commit run --hook-stage manual python-typing-update --all-files
$ git commit -a --amend --no-edit
```
7 changes: 5 additions & 2 deletions glocaltokens/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
import logging
import random

from ghome_foyer_api.api_pb2 import ( # pylint: disable=no-name-in-module
GetHomeGraphRequest,
GetHomeGraphResponse,
)
from ghome_foyer_api.api_pb2_grpc import StructuresServiceStub
from gpsoauth import perform_master_login, perform_oauth
import grpc
from zeroconf import Zeroconf
Expand All @@ -21,8 +26,6 @@
GOOGLE_HOME_FOYER_API,
HOMEGRAPH_DURATION,
)
from .google.internal.home.foyer.v1_pb2 import GetHomeGraphRequest, GetHomeGraphResponse
from .google.internal.home.foyer.v1_pb2_grpc import StructuresServiceStub
from .scanner import NetworkDevice, discover_devices
from .types import DeviceDict
from .utils import network as net_utils, token as token_utils
Expand Down
Empty file removed glocaltokens/google/__init__.py
Empty file.
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit 80c5587

Please sign in to comment.