Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ from frequenz.dispatch import Created, Deleted, Dispatcher, Updated

async def main() -> None:
url = os.getenv("DISPATCH_API_URL", "grpc://localhost:50051")
auth_key = os.getenv("DISPATCH_API_AUTH_KEY", "my-api-key")
sign_secret = os.getenv("DISPATCH_API_SIGN_SECRET")
auth_key = os.getenv("FREQUENZ_API_KEY", "my-api-key")
sign_secret = os.getenv("FREQUENZ_API_SECRET")
microgrid_id = 1

async with Dispatcher(
Expand Down Expand Up @@ -118,8 +118,8 @@ async def run() -> None:
url = os.getenv(
"DISPATCH_API_URL", "grpc://dispatch.api.example.com:50051"
)
auth_key = os.getenv("DISPATCH_API_AUTH_KEY", "my-api-key")
sign_secret = os.getenv("DISPATCH_API_SIGN_SECRET")
auth_key = os.getenv("FREQUENZ_API_KEY", "my-api-key")
sign_secret = os.getenv("FREQUENZ_API_SECRET")

microgrid_id = 1

Expand Down
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->

- Credential examples now use `FREQUENZ_API_KEY` and `FREQUENZ_API_SECRET`.

## New Features

<!-- Here goes the main new features and examples or instructions on how to use them -->
Expand Down
4 changes: 2 additions & 2 deletions src/frequenz/dispatch/_actor_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ def _update_dispatch_information(self, dispatch_update: DispatchInfo) -> None:

async def main():
url = os.getenv("DISPATCH_API_URL", "grpc://dispatch.url.goes.here.example.com")
auth_key = os.getenv("DISPATCH_API_AUTH_KEY", "some-key")
sign_secret = os.getenv("DISPATCH_API_SIGN_SECRET")
auth_key = os.getenv("FREQUENZ_API_KEY", "some-key")
sign_secret = os.getenv("FREQUENZ_API_SECRET")

microgrid_id = 1

Expand Down
16 changes: 8 additions & 8 deletions src/frequenz/dispatch/_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ async def create_actor(dispatch: DispatchInfo, receiver: Receiver[DispatchInfo])

async def run():
url = os.getenv("DISPATCH_API_URL", "grpc://dispatch.url.goes.here.example.com")
key = os.getenv("DISPATCH_API_KEY", "some-key")
auth_key = os.getenv("FREQUENZ_API_KEY", "some-key")

microgrid_id = 1

async with Dispatcher(
microgrid_id=microgrid_id,
server_url=url,
auth_key=key
auth_key=auth_key
) as dispatcher:
await dispatcher.start_managing(
dispatch_type="DISPATCH_TYPE",
Expand All @@ -85,14 +85,14 @@ async def run():

async def run():
url = os.getenv("DISPATCH_API_URL", "grpc://dispatch.url.goes.here.example.com")
key = os.getenv("DISPATCH_API_KEY", "some-key")
auth_key = os.getenv("FREQUENZ_API_KEY", "some-key")

microgrid_id = 1

async with Dispatcher(
microgrid_id=microgrid_id,
server_url=url,
auth_key=key
auth_key=auth_key
) as dispatcher:
actor = MagicMock() # replace with your actor

Expand Down Expand Up @@ -130,14 +130,14 @@ async def run():

async def run():
url = os.getenv("DISPATCH_API_URL", "grpc://dispatch.url.goes.here.example.com")
key = os.getenv("DISPATCH_API_KEY", "some-key")
auth_key = os.getenv("FREQUENZ_API_KEY", "some-key")

microgrid_id = 1

async with Dispatcher(
microgrid_id=microgrid_id,
server_url=url,
auth_key=key,
auth_key=auth_key,
) as dispatcher:
events_receiver = dispatcher.new_lifecycle_events_receiver("DISPATCH_TYPE")

Expand Down Expand Up @@ -167,14 +167,14 @@ async def run():

async def run():
url = os.getenv("DISPATCH_API_URL", "grpc://dispatch.url.goes.here.example.com")
key = os.getenv("DISPATCH_API_KEY", "some-key")
auth_key = os.getenv("FREQUENZ_API_KEY", "some-key")

microgrid_id = 1

async with Dispatcher(
microgrid_id=microgrid_id,
server_url=url,
auth_key=key,
auth_key=auth_key,
) as dispatcher:
# Create a new dispatch
new_dispatch = await dispatcher.client.create(
Expand Down