Fixed docs

This commit is contained in:
Fabio Manganiello 2020-01-09 23:40:59 +01:00
parent f2de1015a8
commit 4c3140c9b5
18 changed files with 80 additions and 95 deletions

View file

@ -45,6 +45,7 @@ Backends
platypush/backend/sensor.distance.vl53l1x.rst
platypush/backend/sensor.envirophat.rst
platypush/backend/sensor.ir.zeroborg.rst
platypush/backend/sensor.leap.rst
platypush/backend/sensor.ltr559.rst
platypush/backend/sensor.mcp3008.rst
platypush/backend/sensor.motion.pwm3901.rst

View file

@ -23,8 +23,8 @@ import sys
# -- Project information -----------------------------------------------------
project = 'platypush'
copyright = '2018, BlackLight'
author = 'BlackLight'
copyright = '2017-2019, Fabio Manganiello'
author = 'Fabio Manganiello'
# The short X.Y version
version = ''
@ -49,6 +49,7 @@ extensions = [
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx_rtd_theme',
]
# Add any paths that contain templates here, relative to this directory.
@ -84,8 +85,8 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster'
html_theme = 'nature'
# html_theme = 'haiku'
html_theme = 'sphinx_rtd_theme'
html_domain_indices = True

View file

@ -1,6 +0,0 @@
``platypush.backend``
=====================
.. automodule:: platypush.backend
:members:

View file

@ -1,6 +0,0 @@
``platypush.backend.camera``
============================
.. automodule:: platypush.backend.camera
:members:

View file

@ -1,6 +0,0 @@
``platypush.backend.http.request.rss``
======================================
.. automodule:: platypush.backend.http.request.rss
:members:

View file

@ -1,6 +0,0 @@
``platypush.backend.weather.forecast``
======================================
.. automodule:: platypush.backend.weather.forecast
:members:

View file

@ -1,6 +0,0 @@
``platypush.plugins.weather.forecast``
======================================
.. automodule:: platypush.plugins.weather.forecast
:members:

View file

@ -18,7 +18,7 @@ class LocalBackend(Backend):
You can use this backend either to send local commands to push through
Pusher (or any other script), or debug. You can even send command on the
command line and read the responses in this way:
command line and read the responses in this way::
# Send the request. Remember: the JSON must be all on one line.
$ cat <<EOF > /tmp/platypush-requests.fifo

View file

@ -69,8 +69,7 @@ class Event(Message):
def matches_condition(self, condition):
"""
If the event matches an event condition, it will return an EventMatchResult
Params:
-- condition -- The platypush.event.hook.EventCondition object
:param condition: The platypush.event.hook.EventCondition object
"""
result = EventMatchResult(is_match=False, parsed_args=self.args)
@ -207,12 +206,11 @@ class StopEvent(Event):
def __init__(self, target, origin, thread_id, id=None, **kwargs):
""" Constructor.
Params:
target -- Target node
origin -- Origin node
thread_id -- thread_iden() to be terminated if listening on the bus
id -- Event ID (default: auto-generated)
kwargs -- Extra key-value arguments
:param target: Target node
:param origin: Origin node
:param thread_id: thread_iden() to be terminated if listening on the bus
:param id: Event ID (default: auto-generated)
:param kwargs: Extra key-value arguments
"""
super().__init__(target=target, origin=origin, id=id,

View file

@ -139,7 +139,7 @@ class GoogleDrivePlugin(GooglePlugin):
:param path: Path of the file to upload.
:param mime_type: MIME type of the source file (e.g. "``image/jpeg``").
:param name: Name of the target file. Default: same name as the source file.
:param description; File description.
:param description: File description.
:param parents: List of folder IDs that will contain the file (default: drive root).
:param starred: If True, then the uploaded file will be marked as starred by the user.
:param target_mime_type: Target MIME type. Useful if you want to e.g. import a CSV file as a Google Sheet

View file

@ -38,7 +38,9 @@ class GpioSensorBme280Plugin(GpioSensorPlugin):
@action
def get_measurement(self):
"""
:returns: dict. Example::
:returns: dict. Example:
.. code-block:: python
output = {
"temperature": 21.0, # Celsius

View file

@ -45,7 +45,9 @@ class GpioSensorDistanceVl53L1XPlugin(GpioSensorPlugin):
:param medium: Enable medium range measurement (default: False)
:param long: Enable long range measurement (default: False)
:returns: dict. Example::
:returns: dict. Example:
.. code-block:: python
output = {
"short": 83, # Short range measurement in mm

View file

@ -19,7 +19,9 @@ class GpioSensorEnvirophatPlugin(GpioSensorPlugin):
:param: qnh: Local value for atmospheric pressure adjusted to sea level (default: 1020)
:type qnh: float
:returns: dict. Example::
:returns: dict. Example:
.. code-block:: python
output = {
"temperature": 21.0, # Celsius

View file

@ -19,8 +19,10 @@ class GpioSensorLtr559Plugin(GpioSensorPlugin):
@action
def get_measurement(self):
"""
:returns: dict. Example::
: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

@ -82,7 +82,9 @@ class GpioSensorMotionPwm3901Plugin(GpioSensorPlugin):
@action
def get_measurement(self):
"""
:returns: dict. Example::
:returns: dict. Example:
.. code-block:: python
output = {
"motion_x": 3, # Detected motion vector X-coord

View file

@ -384,7 +384,9 @@ class MediaPlugin(Plugin):
the streaming link instead of streaming it
:type download: bool
:returns: dict containing the streaming URL.Example::
:return: dict containing the streaming URL.Example:
.. code-block:: json
{
"id": "0123456abcdef.mp4",
@ -392,6 +394,7 @@ class MediaPlugin(Plugin):
"mime_type": "video/mp4",
"url": "http://192.168.1.2:8008/media/0123456abcdef.mp4"
}
"""
import requests

View file

@ -10,10 +10,12 @@ class MediaCtrlPlugin(Plugin):
"""
Wrapper plugin to control audio and video media.
Examples of supported URL types:
- file:///media/movies/Movie.mp4 [requires media plugin enabled]
- youtube:video:poAk9XgK7Cs [requires media plugin+youtube-dl]
- magnet:?torrent_magnet [requires torrentcast]
- spotify:track:track_id [leverages plugins.music.mpd]
"""
_supported_plugins = {

View file

@ -358,9 +358,9 @@ class MobileJoinPlugin(Plugin):
displayed lower in the notification list. Values from -2 (lowest priority) to 2 (highest priority).
Default is 2.
:param vibration_pattern: If the notification is received on an Android device, the vibration pattern in this
field will change the way the device vibrates with it. You can easily create a pattern by going
`here <http://autoremotejoaomgcd.appspot.com/AutoRemoteNotification.html>`_ and generating the pattern in
the Vibration Pattern field
field will change the way the device vibrates with it. You can easily create a pattern by going to the
`AutoRemote notification page <http://autoremotejoaomgcd.appspot.com/AutoRemoteNotification.html>`_
and generate the pattern in the Vibration Pattern field
:type vibration_pattern: str (comma-separated float values) or list[float]
:param dismiss_on_touch: If set the notification will be dismissed when touched (default: False)
:param image: Publicly available URL for an image to show up in the notification
@ -368,7 +368,7 @@ class MobileJoinPlugin(Plugin):
:param sound: Publicly available URL for a sound to play with the notification
:param actions: Set notification buttons with customized behaviour. This parameter is a list of Join actions
configured on the target device that will be mapped to notification input elements.
More info `here <https://joaoapps.com/join/actions/#notifications>`_
More info `on the Joaoapps notifications page <https://joaoapps.com/join/actions/#notifications>`_
"""
params = {'dismissOnTouch': dismiss_on_touch}