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

support ovos backend services #19

Closed
JarbasAl opened this issue Aug 21, 2022 · 1 comment · Fixed by #26
Closed

support ovos backend services #19

JarbasAl opened this issue Aug 21, 2022 · 1 comment · Fixed by #26
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@JarbasAl
Copy link
Member

JarbasAl commented Aug 21, 2022

for weather and wolfram alpha support should be added for ovos api - https://github.com/OpenVoiceOS/ovos_api_service

example weather integration

import requests
from ovos_utils import ovos_service_api


class OvosWeather:
    def __init__(self):
        self.api = ovos_service_api.OVOSApiService()
        self.api.register_device()

    def get_weather_onecall(self, query):
        self.api.get_session_challenge()
        headers = {'session_challenge': self.api.get_session_token(),  'backend': 'OWM'}
        reqdata = {"lat": query.get("lat"), 
                   "lon": query.get("lon"), 
                   "units": query.get("units"),
                   "lang": query.get("lang")}
        url = 'https://api.openvoiceos.com/weather/onecall_weather_report/' + self.api.get_uuid()
        r = requests.post(url, data=reqdata, headers=headers)
        return r.json()

this should also be made the default to ensure functionality is always available, users will still be able and encouraged to use their own keys

@JarbasAl JarbasAl added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Aug 21, 2022
@JarbasAl
Copy link
Member Author

JarbasAl commented Aug 24, 2022

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant