Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

PM init configured backend api #51

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

emphasize
Copy link
Member

@emphasize emphasize commented Sep 20, 2023

Problem:

With defaulting to 0.0.0.0:6712 we determine the url the DeviceApi gets initialized with, resulting in configured backends inheriting this url and making api calls except (if url mismatch).

with None passed the device api defaults to BackendType.OFFLINE with the url http://127.0.0.1

def get_backend_config(url=None, version="v1", identity_file=None, backend_type=None):
config = Configuration()
config_server = config.get("server") or {}
if not url:
url = config_server.get("url")
version = config_server.get("version") or version
backend_type = backend_type or get_backend_type(config)
elif not backend_type:
backend_type = get_backend_type({"url": url})
if not url and backend_type:
if backend_type == BackendType.PERSONAL:
url = "http://0.0.0.0:6712"
else:
url = "http://127.0.0.1"

What i don't get why the default was set up effectively as BackendType.PERSONAL


self.api_url can be retrieved with self.api.backend_url

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

❗ No coverage uploaded for pull request base (dev@c0c8955). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@          Coverage Diff          @@
##             dev     #51   +/-   ##
=====================================
  Coverage       ?   0.00%           
=====================================
  Files          ?      14           
  Lines          ?    2582           
  Branches       ?       0           
=====================================
  Hits           ?       0           
  Misses         ?    2582           
  Partials       ?       0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JarbasAl JarbasAl added the bug Something isn't working label Sep 20, 2023
@JarbasAl JarbasAl merged commit 73c0d1c into OpenVoiceOS:dev Sep 20, 2023
@github-actions github-actions bot mentioned this pull request Dec 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants