ReadTheDocs fixes

This commit is contained in:
Fabio Manganiello 2020-08-24 01:14:40 +02:00
parent 5d2e74eb97
commit 2e6388f6f4
17 changed files with 236 additions and 258 deletions

View File

@ -6,7 +6,6 @@ Events
:maxdepth: 2
:caption: Events:
platypush/events/.rst
platypush/events/adafruit.rst
platypush/events/alarm.rst
platypush/events/application.rst

View File

@ -1,5 +0,0 @@
``platypush.backend.stt.picovoice``
===================================
.. automodule:: platypush.backend.stt.picovoice
:members:

View File

@ -1,6 +0,0 @@
``platypush.plugins.google.credentials``
========================================
.. automodule:: platypush.plugins.google.credentials
:members:

View File

@ -1,6 +0,0 @@
``platypush.plugins.media.search.local``
========================================
.. automodule:: platypush.plugins.media.search.local
:members:

View File

@ -1,6 +0,0 @@
``platypush.plugins.media.search.torrent``
==========================================
.. automodule:: platypush.plugins.media.search.torrent
:members:

View File

@ -1,6 +0,0 @@
``platypush.plugins.media.search.youtube``
==========================================
.. automodule:: platypush.plugins.media.search.youtube
:members:

View File

@ -10,13 +10,18 @@ class Response(Message):
def __init__(self, target=None, origin=None, id=None, output=None, errors=None,
timestamp=None, disable_logging=False):
"""
Params:
target -- Target [String]
origin -- Origin [String]
output -- Output [String]
errors -- Errors [List of strings or exceptions]
id -- Message ID this response refers to
timestamp -- Message timestamp [Float]
:param target: Target
:type target: str
:param origin: Origin
:type origin: str
:param output: Output
:type output: str
:param errors: Errors
:type errors: list
:param id: Message ID this response refers to
:type id: str
:param timestamp: Message timestamp
:type timestamp: float
"""
super().__init__(timestamp=timestamp)
@ -63,7 +68,7 @@ class Response(Message):
def __str__(self):
"""
Overrides the str() operator and converts
Overrides the ``str()`` operator and converts
the message into a UTF-8 JSON string
"""
output = self.output if self.output is not None else {

View File

@ -43,7 +43,9 @@ class BluetoothLookupNameResponse(BluetoothResponse):
class BluetoothLookupServiceResponse(BluetoothResponse):
"""
Example services response output::
Example services response output:
.. code-block:: json
[
{
@ -92,6 +94,7 @@ class BluetoothLookupServiceResponse(BluetoothResponse):
"host": "00:11:22:33:44:57"
}
]
"""
def __init__(self, services: list, *args, **kwargs):
self.services = services
@ -100,7 +103,9 @@ class BluetoothLookupServiceResponse(BluetoothResponse):
class BluetoothDiscoverPrimaryResponse(BluetoothResponse):
"""
Example services response output::
Example services response output:
.. code-block:: json
[
{
@ -133,7 +138,9 @@ class BluetoothDiscoverPrimaryResponse(BluetoothResponse):
class BluetoothDiscoverCharacteristicsResponse(BluetoothResponse):
"""
Example services response output::
Example services response output:
.. code-block:: json
[
{

View File

@ -5,7 +5,7 @@ from platypush.message.response.camera import CameraResponse
class AndroidCameraStatusResponse(CameraResponse):
"""
Sample response::
Example response:
.. code-block:: json

View File

@ -34,6 +34,7 @@ class AssistantGooglePushtotalkPlugin(AssistantPlugin):
* **tenacity** (``pip install tenacity``)
* **google-assistant-sdk** (``pip install google-assistant-sdk[samples]``)
"""
api_endpoint = 'embeddedassistant.googleapis.com'
@ -214,7 +215,6 @@ class AssistantGooglePushtotalkPlugin(AssistantPlugin):
:param language: Language code override (default: default configured language).
:param tts_plugin: Optional text-to-speech plugin to be used for rendering text.
:param tts_args: Optional arguments for the TTS plugin say method.
:returns: A list of the interactions that happen within the conversation.
..code-block:: json
@ -223,13 +223,10 @@ class AssistantGooglePushtotalkPlugin(AssistantPlugin):
{
"request": "request 1",
"response": "response 1"
},
{
"request": "request 2",
"response": "response 2"
}
]

View File

@ -75,7 +75,7 @@ class FoursquarePlugin(Plugin):
:param query: Search query (e.g. "coffee shops" or "restaurants").
:param limit: Maximum number of results.
:param url: Venue URL to search.
:param categories: List of ``category IDs <https://developer.foursquare.com/docs/resources/categories>``_
:param categories: List of `category IDs <https://developer.foursquare.com/docs/resources/categories>`_
to be searched.
:param radius: Search radius in meters.
:param sw: South/west boundary box as a ``[latitude, longitude]`` pair.
@ -157,7 +157,7 @@ class FoursquarePlugin(Plugin):
:param query: Search query (e.g. "coffee shops" or "restaurants"). The parameter has no effect if
``section`` is specified.
:param limit: Maximum number of results.
:param categories: List of ``category IDs <https://developer.foursquare.com/docs/resources/categories>``_
:param categories: List of `category IDs <https://developer.foursquare.com/docs/resources/categories>`_
to be searched.
:param radius: Search radius in meters.
:param open_now: Filter by open/not open now.

View File

@ -16,13 +16,13 @@ class GoogleTranslatePlugin(Plugin):
1. Create a project on the `Google Cloud console <https://console.cloud.google.com/projectcreate>`_ if
you don't have one already.
2. In the menu navigate to the _Artificial Intelligence_ section and select _Translations_ and enable the API.
2. In the menu navigate to the *Artificial Intelligence* section and select *Translations* and enable the API.
3. From the menu select _APIs & Services_ and create a service account. You can leave role and permissions
3. From the menu select *APIs & Services* and create a service account. You can leave role and permissions
empty.
4. Create a new private JSON key for the service account and download it. By default platypush will look for the
credentials file under ~/.credentials/platypush/google/translate.json.
credentials file under ``~/.credentials/platypush/google/translate.json``.
Requires:

View File

@ -22,7 +22,7 @@ class GpioSensorLtr559Plugin(GpioSensorPlugin):
:returns: dict. Example:
.. code-block:: python
:
output = {
"light": 109.3543, # Lux
"proximity": 103 # The higher the value, the nearest the object, within a ~5cm range

View File

@ -1,7 +1,6 @@
import os
from typing import Optional, Union
import deepspeech
import numpy as np
import wave
@ -79,6 +78,7 @@ class SttDeepspeechPlugin(SttPlugin):
:param block_duration: Duration of the acquired audio blocks (default: 1 second).
"""
import deepspeech
super().__init__(*args, **kwargs)
self.model_file = os.path.abspath(os.path.expanduser(model_file))
self.lm_file = os.path.abspath(os.path.expanduser(lm_file))
@ -89,7 +89,8 @@ class SttDeepspeechPlugin(SttPlugin):
self._model: Optional[deepspeech.Model] = None
self._context = None
def _get_model(self) -> deepspeech.Model:
def _get_model(self):
import deepspeech
if not self._model:
self._model = deepspeech.Model(self.model_file, self.beam_width)
self._model.enableDecoderWithLM(self.lm_file, self.trie_file, self.lm_alpha, self.lm_beta)

View File

@ -86,8 +86,7 @@ class ZeroconfPlugin(Plugin):
:param service: Service type (e.g. ``_http._tcp.local.``).
:param timeout: Browser timeout in seconds (default: 5). Specify None for no timeout - in such case the
discovery will loop forever and generate events upon service changes.
:return: A ``service_type -> [service_names]`` mapping. Example::
:return: A ``service_type -> [service_names]`` mapping. Example:
.. code-block:: json
@ -109,8 +108,7 @@ class ZeroconfPlugin(Plugin):
"server": "host1._platypush-http._tcp.local.",
"weight": 0
}
},
...
}
}
"""

View File

@ -19,7 +19,7 @@ class ZigbeeMqttPlugin(MqttPlugin):
- Install `cc-tool <https://github.com/dashesy/cc-tool>`_ either from sources or from a package manager.
- Connect the Zigbee to your PC/RaspberryPi in this way: USB -> CC debugger -> downloader cable -> CC2531 -> USB.
The debugger and the adapter should be connected _at the same time_. If the later ``cc-tool`` command throws up
The debugger and the adapter should be connected *at the same time*. If the later ``cc-tool`` command throws up
an error, put the device in sync while connected by pressing the _Reset_ button on the debugger.
- Check where the device is mapped. On Linux it will usually be ``/dev/ttyACM0``.
- Download the latest `Z-Stack firmware <https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator>`_ to your device.