Fixed auto-generated docs indentation and code blocks

This commit is contained in:
Fabio Manganiello 2020-08-31 17:39:42 +02:00
parent e533484505
commit 3c3ee09d90
13 changed files with 278 additions and 298 deletions

View file

@ -1,5 +0,0 @@
``platypush.message.event``
===========================
.. automodule:: platypush.message.event
:members:

View file

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

View file

@ -1,5 +0,0 @@
``platypush.message.response.deepspeech``
=========================================
.. automodule:: platypush.message.response.deepspeech
:members:

View file

@ -69,43 +69,43 @@ class MailBackend(Backend):
The ``name`` parameter can be used to identify this mailbox in the relevant events, otherwise The ``name`` parameter can be used to identify this mailbox in the relevant events, otherwise
``Mailbox #{id}`` will be used as a name. Example configuration: ``Mailbox #{id}`` will be used as a name. Example configuration:
.. code-block:: yaml .. code-block:: yaml
backend.mail: backend.mail:
mailboxes: mailboxes:
- plugin: mail.imap - plugin: mail.imap
name: "My Local Server" name: "My Local Server"
username: me@mydomain.com username: me@mydomain.com
password: my-imap-password password: my-imap-password
server: localhost server: localhost
ssl: true ssl: true
folder: "All Mail" folder: "All Mail"
- plugin: mail.imap - plugin: mail.imap
name: "GMail" name: "GMail"
username: me@gmail.com username: me@gmail.com
password: my-google-password password: my-google-password
server: imap.gmail.com server: imap.gmail.com
ssl: true ssl: true
folder: "INBOX" folder: "INBOX"
If you have a default configuration available for a mail plugin you can implicitly reuse it without If you have a default configuration available for a mail plugin you can implicitly reuse it without
replicating it here. Example: replicating it here. Example:
.. code-block:: yaml .. code-block:: yaml
mail.imap: mail.imap:
username: me@mydomain.com username: me@mydomain.com
password: my-imap-password password: my-imap-password
server: localhost server: localhost
ssl: true ssl: true
backend.mail: backend.mail:
mailboxes: mailboxes:
# The mail.imap default configuration will be used # The mail.imap default configuration will be used
- plugin: mail.imap - plugin: mail.imap
name: "My Local Server" name: "My Local Server"
folder: "All Mail" folder: "All Mail"
:param timeout: Connect/read timeout for a mailbox, in seconds (default: 60). :param timeout: Connect/read timeout for a mailbox, in seconds (default: 60).
""" """

View file

@ -45,55 +45,55 @@ class BluetoothLookupServiceResponse(BluetoothResponse):
""" """
Example services response output: Example services response output:
.. code-block:: json .. code-block:: json
[ [
{ {
"service-classes": [ "service-classes": [
"1801" "1801"
], ],
"profiles": [], "profiles": [],
"name": "Service name #1", "name": "Service name #1",
"description": null, "description": null,
"provider": null, "provider": null,
"service-id": null, "service-id": null,
"protocol": "L2CAP", "protocol": "L2CAP",
"port": 31, "port": 31,
"host": "00:11:22:33:44:55" "host": "00:11:22:33:44:55"
}, },
{ {
"service-classes": [ "service-classes": [
"1800" "1800"
], ],
"profiles": [], "profiles": [],
"name": "Service name #2", "name": "Service name #2",
"description": null, "description": null,
"provider": null, "provider": null,
"service-id": null, "service-id": null,
"protocol": "L2CAP", "protocol": "L2CAP",
"port": 31, "port": 31,
"host": "00:11:22:33:44:56" "host": "00:11:22:33:44:56"
}, },
{ {
"service-classes": [ "service-classes": [
"1112", "1112",
"1203" "1203"
], ],
"profiles": [ "profiles": [
[ [
"1108", "1108",
258 258
] ]
], ],
"name": "Headset Gateway", "name": "Headset Gateway",
"description": null, "description": null,
"provider": null, "provider": null,
"service-id": null, "service-id": null,
"protocol": "RFCOMM", "protocol": "RFCOMM",
"port": 2, "port": 2,
"host": "00:11:22:33:44:57" "host": "00:11:22:33:44:57"
} }
] ]
""" """
def __init__(self, services: list, *args, **kwargs): def __init__(self, services: list, *args, **kwargs):
@ -105,30 +105,30 @@ class BluetoothDiscoverPrimaryResponse(BluetoothResponse):
""" """
Example services response output: Example services response output:
.. code-block:: json .. code-block:: json
[ [
{ {
"uuid": "00001800-0000-1000-8000-00805f9b34fb", "uuid": "00001800-0000-1000-8000-00805f9b34fb",
"start": 1, "start": 1,
"end": 7 "end": 7
}, },
{ {
"uuid": "00001801-0000-1000-8000-00805f9b34fb", "uuid": "00001801-0000-1000-8000-00805f9b34fb",
"start": 8, "start": 8,
"end": 8 "end": 8
}, },
{ {
"uuid": "0000fee7-0000-1000-8000-00805f9b34fb", "uuid": "0000fee7-0000-1000-8000-00805f9b34fb",
"start": 9, "start": 9,
"end": 16 "end": 16
}, },
{ {
"uuid": "cba20d00-224d-11e6-9fb8-0002a5d5c51b", "uuid": "cba20d00-224d-11e6-9fb8-0002a5d5c51b",
"start": 17, "start": 17,
"end": 65535 "end": 65535
} }
] ]
""" """
def __init__(self, services: list, *args, **kwargs): def __init__(self, services: list, *args, **kwargs):
@ -140,58 +140,58 @@ class BluetoothDiscoverCharacteristicsResponse(BluetoothResponse):
""" """
Example services response output: Example services response output:
.. code-block:: json .. code-block:: json
[ [
{ {
"uuid": "00002a00-0000-1000-8000-00805f9b34fb", "uuid": "00002a00-0000-1000-8000-00805f9b34fb",
"handle": 2, "handle": 2,
"properties": 10, "properties": 10,
"value_handle": 3 "value_handle": 3
}, },
{ {
"uuid": "00002a01-0000-1000-8000-00805f9b34fb", "uuid": "00002a01-0000-1000-8000-00805f9b34fb",
"handle": 4, "handle": 4,
"properties": 2, "properties": 2,
"value_handle": 5 "value_handle": 5
}, },
{ {
"uuid": "00002a04-0000-1000-8000-00805f9b34fb", "uuid": "00002a04-0000-1000-8000-00805f9b34fb",
"handle": 6, "handle": 6,
"properties": 2, "properties": 2,
"value_handle": 7 "value_handle": 7
}, },
{ {
"uuid": "0000fec8-0000-1000-8000-00805f9b34fb", "uuid": "0000fec8-0000-1000-8000-00805f9b34fb",
"handle": 10, "handle": 10,
"properties": 32, "properties": 32,
"value_handle": 11 "value_handle": 11
}, },
{ {
"uuid": "0000fec7-0000-1000-8000-00805f9b34fb", "uuid": "0000fec7-0000-1000-8000-00805f9b34fb",
"handle": 13, "handle": 13,
"properties": 8, "properties": 8,
"value_handle": 14 "value_handle": 14
}, },
{ {
"uuid": "0000fec9-0000-1000-8000-00805f9b34fb", "uuid": "0000fec9-0000-1000-8000-00805f9b34fb",
"handle": 15, "handle": 15,
"properties": 2, "properties": 2,
"value_handle": 16 "value_handle": 16
}, },
{ {
"uuid": "cba20003-224d-11e6-9fb8-0002a5d5c51b", "uuid": "cba20003-224d-11e6-9fb8-0002a5d5c51b",
"handle": 18, "handle": 18,
"properties": 16, "properties": 16,
"value_handle": 19 "value_handle": 19
}, },
{ {
"uuid": "cba20002-224d-11e6-9fb8-0002a5d5c51b", "uuid": "cba20002-224d-11e6-9fb8-0002a5d5c51b",
"handle": 21, "handle": 21,
"properties": 12, "properties": 12,
"value_handle": 22 "value_handle": 22
} }
] ]
""" """
def __init__(self, characteristics: list, *args, **kwargs): def __init__(self, characteristics: list, *args, **kwargs):

View file

@ -7,56 +7,56 @@ class AndroidCameraStatusResponse(CameraResponse):
""" """
Example response: Example response:
.. code-block:: json .. code-block:: json
{ {
"stream_url": "https://192.168.1.30:8080/video", "stream_url": "https://192.168.1.30:8080/video",
"image_url": "https://192.168.1.30:8080/photo.jpg", "image_url": "https://192.168.1.30:8080/photo.jpg",
"audio_url": "https://192.168.1.30:8080/audio.wav", "audio_url": "https://192.168.1.30:8080/audio.wav",
"orientation": "landscape", "orientation": "landscape",
"idle": "off", "idle": "off",
"audio_only": "off", "audio_only": "off",
"overlay": "off", "overlay": "off",
"quality": "49", "quality": "49",
"focus_homing": "off", "focus_homing": "off",
"ip_address": "192.168.1.30", "ip_address": "192.168.1.30",
"motion_limit": "250", "motion_limit": "250",
"adet_limit": "200", "adet_limit": "200",
"night_vision": "off", "night_vision": "off",
"night_vision_average": "2", "night_vision_average": "2",
"night_vision_gain": "1.0", "night_vision_gain": "1.0",
"motion_detect": "off", "motion_detect": "off",
"motion_display": "off", "motion_display": "off",
"video_chunk_len": "60", "video_chunk_len": "60",
"gps_active": "off", "gps_active": "off",
"video_size": "1920x1080", "video_size": "1920x1080",
"mirror_flip": "none", "mirror_flip": "none",
"ffc": "off", "ffc": "off",
"rtsp_video_formats": "", "rtsp_video_formats": "",
"rtsp_audio_formats": "", "rtsp_audio_formats": "",
"video_connections": "0", "video_connections": "0",
"audio_connections": "0", "audio_connections": "0",
"ivideon_streaming": "off", "ivideon_streaming": "off",
"zoom": "100", "zoom": "100",
"crop_x": "50", "crop_x": "50",
"crop_y": "50", "crop_y": "50",
"coloreffect": "none", "coloreffect": "none",
"scenemode": "auto", "scenemode": "auto",
"focusmode": "continuous-video", "focusmode": "continuous-video",
"whitebalance": "auto", "whitebalance": "auto",
"flashmode": "off", "flashmode": "off",
"antibanding": "off", "antibanding": "off",
"torch": "off", "torch": "off",
"focus_distance": "0.0", "focus_distance": "0.0",
"focal_length": "4.25", "focal_length": "4.25",
"aperture": "1.7", "aperture": "1.7",
"filter_density": "0.0", "filter_density": "0.0",
"exposure_ns": "9384", "exposure_ns": "9384",
"frame_duration": "33333333", "frame_duration": "33333333",
"iso": "100", "iso": "100",
"manual_sensor": "off", "manual_sensor": "off",
"photo_size": "1920x1080" "photo_size": "1920x1080"
} }
""" """

View file

@ -217,18 +217,18 @@ class AssistantGooglePushtotalkPlugin(AssistantPlugin):
:param tts_args: Optional arguments for the TTS plugin say method. :param tts_args: Optional arguments for the TTS plugin say method.
:returns: A list of the interactions that happen within the conversation. :returns: A list of the interactions that happen within the conversation.
.. code-block:: json .. code-block:: json
[ [
{ {
"request": "request 1", "request": "request 1",
"response": "response 1" "response": "response 1"
}, },
{ {
"request": "request 2", "request": "request 2",
"response": "response 2" "response": "response 2"
} }
] ]
""" """

View file

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

View file

@ -20,8 +20,8 @@ class LcdI2cPlugin(LcdPlugin):
Pin mapping:: Pin mapping::
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
BL | D7 | D6 | D5 | D4 | E | RS | - BL | D7 | D6 | D5 | D4 | E | RS | -
Requires: Requires:
@ -40,20 +40,15 @@ class LcdI2cPlugin(LcdPlugin):
:param i2c_expander: Set your I²C chip type. Supported: "PCF8574", "MCP23008", "MCP23017". :param i2c_expander: Set your I²C chip type. Supported: "PCF8574", "MCP23008", "MCP23017".
:param address: The I2C address of your LCD. :param address: The I2C address of your LCD.
:param expander_params: Parameters for expanders, in a dictionary. Only needed for MCP23017 :param expander_params: Parameters for expanders, in a dictionary. Only needed for MCP23017
gpio_bank - This must be either ``A`` or ``B`` gpio_bank - This must be either ``A`` or ``B``. If you have a HAT, A is usually marked 1 and B is 2.
If you have a HAT, A is usually marked 1 and B is 2.
Example: ``expander_params={'gpio_bank': 'A'}`` Example: ``expander_params={'gpio_bank': 'A'}``
:param port: The I2C port number. Default: ``1``. :param port: The I2C port number. Default: ``1``.
:param cols: Number of columns per row (usually 16 or 20). Default: ``16``. :param cols: Number of columns per row (usually 16 or 20). Default: ``16``.
:param rows: Number of display rows (usually 1, 2 or 4). Default: ``2``. :param rows: Number of display rows (usually 1, 2 or 4). Default: ``2``.
:param backlight_enabled: Whether the backlight is enabled initially. :param backlight_enabled: Whether the backlight is enabled initially. Default: ``True``. Has no effect if pin_backlight is ``None``
Default: ``True``. Has no effect if pin_backlight is ``None`` :param dotsize: Some 1 line displays allow a font height of 10px. Allowed: ``8`` or ``10``. Default: ``8``.
:param dotsize: Some 1 line displays allow a font height of 10px. :param charmap: The character map used. Depends on your LCD. This must be either ``A00`` or ``A02`` or ``ST0B``. Default: ``A02``.
Allowed: ``8`` or ``10``. Default: ``8``. :param auto_linebreaks: Whether or not to automatically insert line breaks. Default: ``True``.
:param charmap: The character map used. Depends on your LCD. This must
be either ``A00`` or ``A02`` or ``ST0B``. Default: ``A02``.
:param auto_linebreaks: Whether or not to automatically insert line
breaks. Default: ``True``.
""" """
super().__init__(**kwargs) super().__init__(**kwargs)

View file

@ -196,7 +196,7 @@ class TensorflowPlugin(Plugin):
:param name: Name of the model. :param name: Name of the model.
:param layers: List of layers. Example: :param layers: List of layers. Example:
.. code-block:: javascript .. code-block:: javascript
[ [
// Input flatten layer with 10 units // Input flatten layer with 10 units
@ -265,7 +265,7 @@ class TensorflowPlugin(Plugin):
:return: The model configuration, as a dict. Example: :return: The model configuration, as a dict. Example:
.. code-block:: json .. code-block:: json
{ {
"name": "test_model", "name": "test_model",
@ -463,7 +463,7 @@ class TensorflowPlugin(Plugin):
:return: Configuration of the model, as a dict. Example: :return: Configuration of the model, as a dict. Example:
.. code-block:: json .. code-block:: json
{ {
"name": "test_regression_model", "name": "test_regression_model",
@ -712,16 +712,15 @@ class TensorflowPlugin(Plugin):
Fraction of the training data to be used as validation data. The model will set apart this fraction Fraction of the training data to be used as validation data. The model will set apart this fraction
of the training data, will not train on it, and will evaluate the loss and any model metrics on this data of the training data, will not train on it, and will evaluate the loss and any model metrics on this data
at the end of each epoch. The validation data is selected from the last samples in the ``x`` and ``y`` at the end of each epoch. The validation data is selected from the last samples in the ``x`` and ``y``
data provided, before shuffling. This argument is not supported when ``x`` is a dataset, generator or data provided, before shuffling. Not supported when ``x`` is a dataset, generator or ``keras.utils.Sequence`` instance.
``keras.utils.Sequence`` instance.
:param validation_data: Data on which to evaluate the loss and any model metrics at the end of each epoch. :param validation_data: Data on which to evaluate the loss and any model metrics at the end of each epoch.
The model will not be trained on this data. ``validation_data`` will override ``validation_split``. The model will not be trained on this data. ``validation_data`` will override ``validation_split``.
``validation_data`` could be: ``validation_data`` could be:
- tuple ``(x_val, y_val)`` of arrays/numpy arrays/tensors - tuple ``(x_val, y_val)`` of arrays/numpy arrays/tensors
- tuple ``(x_val, y_val, val_sample_weights)`` of Numpy arrays - tuple ``(x_val, y_val, val_sample_weights)`` of Numpy arrays
- dataset - dataset
For the first two cases, ``batch_size`` must be provided. For the last case, ``validation_steps`` could be For the first two cases, ``batch_size`` must be provided. For the last case, ``validation_steps`` could be
provided. provided.
@ -966,43 +965,43 @@ class TensorflowPlugin(Plugin):
- For regression models with no output labels specified: ``values`` will contain the output vector: - For regression models with no output labels specified: ``values`` will contain the output vector:
.. code-block:: json .. code-block:: json
{ {
"values": [[3.1415]] "values": [[3.1415]]
} }
- For regression models with output labels specified: ``values`` will be a list of ``{label -> value}`` - For regression models with output labels specified: ``values`` will be a list of ``{label -> value}``
maps: maps:
.. code-block:: json .. code-block:: json
{ {
"values": [ "values": [
{ {
"x": 42.0, "x": 42.0,
"y": 43.0 "y": 43.0
} }
] ]
} }
- For neural networks: ``values`` will contain the list of the output vector like in the case of - For neural networks: ``values`` will contain the list of the output vector like in the case of
regression, and ``labels`` will store the list of ``argmax`` (i.e. the index of the output unit with the regression, and ``labels`` will store the list of ``argmax`` (i.e. the index of the output unit with the
highest value) or their labels, if the model has output labels: highest value) or their labels, if the model has output labels:
.. code-block:: json .. code-block:: json
{ {
"labels": [ "labels": [
"positive" "positive"
], ],
"values": [ "values": [
{ {
"positive": 0.998, "positive": 0.998,
"negative": 0.002 "negative": 0.002
} }
] ]
} }
""" """
name = model name = model

View file

@ -84,9 +84,9 @@ class TwilioPlugin(Plugin):
"MMS": false, "MMS": false,
"fax": false "fax": false
} }
}, }
...
] ]
""" """
phone_numbers = self.client.available_phone_numbers(country.upper()).fetch() phone_numbers = self.client.available_phone_numbers(country.upper()).fetch()
resp = requests.get(self._api_base_url + phone_numbers.uri, auth=(self.account_sid, self.auth_token)).json() resp = requests.get(self._api_base_url + phone_numbers.uri, auth=(self.account_sid, self.auth_token)).json()
@ -372,6 +372,7 @@ class TwilioPlugin(Plugin):
"to": "+18182008801", "to": "+18182008801",
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMded05904ccb347238880ca9264e8fe1c.json" "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMded05904ccb347238880ca9264e8fe1c.json"
} }
""" """
if to in self.address_book: if to in self.address_book:
to = self.address_book[to] to = self.address_book[to]

View file

@ -88,28 +88,28 @@ class ZeroconfPlugin(Plugin):
discovery will loop forever and generate events upon service changes. 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 .. code-block:: json
{ {
"host1._platypush-http._tcp.local.": { "host1._platypush-http._tcp.local.": {
"type": "_platypush-http._tcp.local.", "type": "_platypush-http._tcp.local.",
"name": "host1._platypush-http._tcp.local.", "name": "host1._platypush-http._tcp.local.",
"info": { "info": {
"addresses": ["192.168.1.11"], "addresses": ["192.168.1.11"],
"port": 8008, "port": 8008,
"host_ttl": 120, "host_ttl": 120,
"other_ttl": 4500, "other_ttl": 4500,
"priority": 0, "priority": 0,
"properties": { "properties": {
"name": "Platypush", "name": "Platypush",
"vendor": "Platypush", "vendor": "Platypush",
"version": "0.13.2" "version": "0.13.2"
}, },
"server": "host1._platypush-http._tcp.local.", "server": "host1._platypush-http._tcp.local.",
"weight": 0 "weight": 0
}
} }
} }
}
""" """
assert not self._discovery_in_progress, 'A discovery process is already running' assert not self._discovery_in_progress, 'A discovery process is already running'

View file

@ -813,7 +813,7 @@ class ZwavePlugin(Plugin):
Add a value to a scene. Add a value to a scene.
WARNING: This method actually doesn't work, by own admission of the WARNING: This method actually doesn't work, by own admission of the
:ref:`OpenZWave developer <https://github.com/OpenZWave/python-openzwave/blob/master/src-lib/libopenzwave/libopenzwave.pyx#L4730>`_ `OpenZWave developer <https://github.com/OpenZWave/python-openzwave/blob/master/src-lib/libopenzwave/libopenzwave.pyx#L4730>`_.
:param data: Data to set for the value (default: current value data). :param data: Data to set for the value (default: current value data).