clean up beta 202204 (#2020)

This commit is contained in:
Guillermo Ruffino 2022-04-21 23:04:23 -03:00 committed by GitHub
parent 3e1d429243
commit a14c881b43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 76 additions and 74 deletions

View File

@ -38,7 +38,7 @@ Configuration variables:
- **hydreon_rgxx_id** (*Optional*, :ref:`config-id`): The ID of the Hydreon Rain Sensor display.
- **too_cold** (*Optional*): `true` if the sensor reports being too cold. Hydreon only mentions this feature for the RG-9.
- **too_cold** (*Optional*): ``true`` if the sensor reports being too cold. Hydreon only mentions this feature for the RG-9.
- **name** (**Required**, string): The name for the voltage sensor.

View File

@ -88,8 +88,8 @@ Automations:
.. _canbus-on-frame:
``on_frame``
************
``on_frame`` Trigger
********************
This automation will be triggered when a CAN frame is received. A variable ``x`` of type
``std::vector<uint8_t>`` containing the frame data and a variable ``can_id`` of type ``uint32_t``

View File

@ -61,21 +61,22 @@ Configuration variables:
- **name** (**Required**, string): The name of the light.
- **leading_edge** (**Optional**, boolean): `Dimming mode <https://en.wikipedia.org/wiki/Dimmer#Solid-state_dimmer>`_: "true" means leading edge, "false" (default) is trailing edge.
- **min_brightness** (**Optional**, int): Minimum brightness value on a scale from 0..1000, the default is 0.
- **max_brightness** (**Optional**, int): Maximum brightness value on a scale from 0..1000, the default is 1000.
- **warmup_brightness** (**Optional**, int): Brightness threshold below which the dimmer switches on later in mains current cycle. `This might help with dimming LEDs <https://github.com/jamesturton/shelly-dimmer-stm32/pull/23>`_. The value is from 0..1000 with an default of 0.
- **nrst_pin** (**Optional**, :ref:`config-pin`): Pin connected with "NRST" of STM32. The default is "GPIO5".
- **boot0_pin** (**Optional**, :ref:`config-pin`): Pin connected with "BOOT0" of STM32. The default is "GPIO4".
- **current** (**Optional**): Sensor of the current in Amperes. All options from
- **leading_edge** (*Optional*, boolean): `Dimming mode <https://en.wikipedia.org/wiki/Dimmer#Solid-state_dimmer>`_: ``true`` means leading edge, ``false`` is trailing edge. Defaults to ``false``.
- **min_brightness** (*Optional*, int): Minimum brightness value on a scale from 0..1000, the default is 0.
- **max_brightness** (*Optional*, int): Maximum brightness value on a scale from 0..1000, the default is 1000.
- **warmup_brightness** (*Optional*, int): Brightness threshold below which the dimmer switches on later in mains current cycle. `This might help with dimming LEDs <https://github.com/jamesturton/shelly-dimmer-stm32/pull/23>`_. The value is from 0..1000 with an default of 0.
- **nrst_pin** (*Optional*, :ref:`config-pin`): Pin connected with "NRST" of STM32. The default is "GPIO5".
- **boot0_pin** (*Optional*, :ref:`config-pin`): Pin connected with "BOOT0" of STM32. The default is "GPIO4".
- **current** (*Optional*): Sensor of the current in Amperes. All options from
:ref:`Sensor <config-sensor>`.
- **voltage** (**Optional**): Sensor of the voltage in Volts. Only accurate if neutral is connected. All options from :ref:`Sensor <config-sensor>`.
- **power** (**Optional**): Sensor of the active power in Watts. Only accurate if neutral is connected. All options from :ref:`Sensor <config-sensor>`.
- **firmware** (**Optional**):
- **version** (**Optional**): Version string of the `firmware <https://github.com/jamesturton/shelly-dimmer-stm32>`_ that will be expected on the microcontroller. The default is "51.6", another known-good firmware is "51.5".
- **url** (**Optional**): An URL to download the firmware from. Defaults to github for known firmware versions.
- **sha256** (**Optional**): A hash to compare the downloaded firmware against. Defaults a proper hash of known firmware versions.
- **update** (**Optional**): Should the firmware of the STM be updated if necessary? The default is false.
- **voltage** (*Optional*): Sensor of the voltage in Volts. Only accurate if neutral is connected. All options from :ref:`Sensor <config-sensor>`.
- **power** (*Optional*): Sensor of the active power in Watts. Only accurate if neutral is connected. All options from :ref:`Sensor <config-sensor>`.
- **firmware** (*Optional*):
- **version** (*Optional*): Version string of the `firmware <https://github.com/jamesturton/shelly-dimmer-stm32>`_ that will be expected on the microcontroller. The default is "51.6", another known-good firmware is "51.5".
- **url** (*Optional*, string): An URL to download the firmware from. Defaults to github for known firmware versions.
- **sha256** (*Optional*): A hash to compare the downloaded firmware against. Defaults a proper hash of known firmware versions.
- **update** (*Optional*): Should the firmware of the STM be updated if necessary? The default is false.
.. note::

View File

@ -91,8 +91,8 @@ This component is useless for devices other than Sonoff D1 dimmer.
default_transition_length: 1s
Configuration variables
-----------------------
Configuration variables:
------------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the light.

View File

@ -79,9 +79,9 @@ Configuration variables:
- **ssl_fingerprints** (*Optional*, list): Only on ESP8266. A list of SHA1 hashes used
for verifying SSL connections. See :ref:`mqtt-ssl_fingerprints`.
for more information.
- **certificate_authority** *(Optional*, string): Only with `esp-idf`. CA certificate in PEM format. See :ref:`mqtt-tls-idf` for more information
- **skip_cert_cn_check** (*Optional*, bool): Only with `esp-idf`. Don't verify if the common name in the server certificate matches the value of ``broker``.
- **idf_send_async** (*Optional*, bool): Only with `esp-idf`. Default is false. If true publishing the message happens from the internal mqtt task. The client only enqueues the message.
- **certificate_authority** (*Optional*, string): Only with ``esp-idf``. CA certificate in PEM format. See :ref:`mqtt-tls-idf` for more information
- **skip_cert_cn_check** (*Optional*, bool): Only with ``esp-idf``. Don't verify if the common name in the server certificate matches the value of ``broker``.
- **idf_send_async** (*Optional*, bool): Only with ``esp-idf``. If true publishing the message happens from the internal mqtt task. The client only enqueues the message. Defaults to ``false``.
The advantage of asyncronous publishing is that it doesn't block the esphome main thread. The disadvantage is a delay (up to 1-2 seconds) until the messages are actually sent out.
Set this to true if ypi send large amounts of of data over mqtt.
- **reboot_timeout** (*Optional*, :ref:`config-time`): The amount of time to wait before rebooting when no

View File

@ -78,7 +78,7 @@ Configuration variables:
- **use_write_multiple** (*Optional*, boolean): By default the modbus command ``Preset Single Registers``
(function code 6) is used for setting the holding register if only 1 register is set. If your device only supports *Preset Multiple Registers* (function code 16) set this option to ``true``. Defaults
to ``false``.
- **optimistic**: (*Optional*, boolean): Whether to operate in optimistic mode - when in this mode,
- **optimistic** (*Optional*, boolean): Whether to operate in optimistic mode - when in this mode,
any command sent to the Modbus Select will immediately update the reported state. Defaults
to ``false``.
- All other options from :ref:`Select <config-select>`.

View File

@ -64,38 +64,38 @@ required to be set up in your configuration for this sensor to work.
Configuration variables:
------------------------
- **model**: (**Required**, int): Specify which rain sensor you have connected. Must be either ``RG_9`` or ``RG_15``.
- **model** (**Required**, int): Specify which rain sensor you have connected. Must be either ``RG_9`` or ``RG_15``.
- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`UART Component <uart>` if you want
to use multiple UART buses.
- **moisture** (*Optional*): Rain intensity level from 0-7. Only on RG-9.
- **name** (**Required**, string): The name for the voltage sensor.
- **name** (**Required**, string): The name for the sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **acc** (*Optional*): Amount of rain since last message (see `update_interval`), in `mm`. Only on RG-15.
- **acc** (*Optional*): Amount of rain since last message (see ``update_interval``), in ``mm``. Only on RG-15.
- **name** (**Required**, string): The name for the voltage sensor.
- **name** (**Required**, string): The name for the sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **event_acc** (*Optional*): Amount of rain for this event (i.e. since it last stopped raining), in `mm`. Only on RG-15.
- **event_acc** (*Optional*): Amount of rain for this event (i.e. since it last stopped raining), in ``mm``. Only on RG-15.
- **name** (**Required**, string): The name for the voltage sensor.
- **name** (**Required**, string): The name for the sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **total_acc** (*Optional*): Total amount of rain this sensor has ever measured, in `mm`. Only on RG-15.
- **total_acc** (*Optional*): Total amount of rain this sensor has ever measured, in ``mm``. Only on RG-15.
- **name** (**Required**, string): The name for the voltage sensor.
- **name** (**Required**, string): The name for the sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **r_int** (*Optional*): Current rain intensity in `mm/h`. Only on RG-15.
- **r_int** (*Optional*): Current rain intensity in ``mm/h``. Only on RG-15.
- **name** (**Required**, string): The name for the voltage sensor.
- **name** (**Required**, string): The name for the sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.

View File

@ -59,7 +59,7 @@ Configuration variables:
web interface. Defaults to ``false``.
- **ota** (*Optional*, boolean): Turn on or off the OTA feature inside webserver. Strongly not suggested without enabled authentication settings. Defaults to ``true``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **version** (*Optional*, string): 1 or 2. Version 1 displays as a table. Version 2 uses web components and has more functionality. Default: `2`
- **version** (*Optional*, string): ``1`` or ``2``. Version 1 displays as a table. Version 2 uses web components and has more functionality. Defaults to ``2``.
.. note::

View File

@ -2,7 +2,6 @@ from genericpath import exists
import re
import json
import urllib
import traceback
from typing import MutableMapping
from sphinx.util import logging
@ -63,14 +62,8 @@ def doctree_resolved(app, doctree, docname):
if docname == "components/index":
# nothing useful here
return
try:
handle_component(app, doctree, docname)
except Exception as e:
err_str = f"In {docname}: {str(e)}"
logger.warning(err_str)
traceback.print_exc()
PLATFORMS_TITLES = {
"Sensor": "sensor",
@ -110,7 +103,7 @@ CUSTOM_DOCS = {
"components/climate/climate_ir": {"_LoadSchema": False, "IR Remote Climate": []},
"components/display/index": {
"Images": "image.schemas.CONFIG_SCHEMA",
"Drawing Static Text": "font.schemas.CONFIG_SCHEMA",
"Fonts": "font.schemas.CONFIG_SCHEMA",
"Color": "color.schemas.CONFIG_SCHEMA",
"Animation": "animation.schemas.CONFIG_SCHEMA",
},
@ -396,6 +389,8 @@ class SchemaGeneratorVisitor(nodes.NodeVisitor):
json_component = self.find_component(self.custom_doc[title_text])
if not json_component:
return
if self.json_component is None:
self.json_component = json_component
parts = self.custom_doc[title_text].split(".")
if parts[0] not in ["core", "remote_base"] and parts[-1] != "pin":
@ -1144,14 +1139,20 @@ def handle_component(app, doctree, docname):
return
v = SchemaGeneratorVisitor(app, doctree, docname)
try:
doctree.walkabout(v)
except Exception as e:
err_str = f"In {docname}.rst: {str(e)}"
logger.warning(err_str)
# print stack
# traceback.print_exc()
def build_finished(app, exception):
# TODO: create report of missing descriptions
for fname, contents in app.files.items():
f = open(SCHEMA_PATH + fname + ".json", "w")
f = open(SCHEMA_PATH + fname + ".json", "w", newline="\n")
if JSON_DUMP_PRETTY:
f.write(json.dumps(contents, indent=2))
else: