Format-fixes-202211 (#2461)

This commit is contained in:
Guillermo Ruffino 2023-01-24 14:56:46 -03:00 committed by GitHub
parent 8a18636d4b
commit 8b7fcf2313
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 125 additions and 94 deletions

View File

@ -124,7 +124,7 @@ Configuration variables:
``bedjet`` Fan
--------------
The `fan` platform exposes the BedJet's fan-related functionality, including
The ``fan`` platform exposes the BedJet's fan-related functionality, including
on/off and speed control.
When the BedJet is already on, turning the Fan component off will set the BedJet unit's mode to

View File

@ -79,15 +79,17 @@ Configuration variables:
- **root_item_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the root menu item.
- **active** (*Optional*, boolean): Whether the menu should start as active, meaning accepting
user interactions and displaying output. Defaults to ``true``.
- **mode** (*Optional*, string): Defines the navigation logic. The ``rotary`` mode expects
the clockwise movement wired to :ref:`display_menu.down <display_menu-down_action>`,
- **mode** (*Optional*, enum): Defines the navigation logic. Defaults to ``rotary``.
- ``rotary``: Rotary mode expects the clockwise movement wired to :ref:`display_menu.down <display_menu-down_action>`,
the anticlockwise one to :ref:`display_menu.up <display_menu-up_action>` and the switch
to :ref:`display_menu.enter <display_menu-enter_action>` action. The ``joystick`` mode
expects the up, down, left and right buttons wired to the :ref:`display_menu.up <display_menu-up_action>`,
to :ref:`display_menu.enter <display_menu-enter_action>` action.
- ``joystick``: Joystick mode expects the up, down, left and right buttons wired to the :ref:`display_menu.up <display_menu-up_action>`,
:ref:`display_menu.down <display_menu-down_action>`, :ref:`display_menu.left <display_menu-left_action>`
and :ref:`display_menu.right <display_menu-right_action>` actions and the middle button
to the :ref:`display_menu.enter <display_menu-enter_action>` action. Defaults to ``rotary``.
- **menu** (**Required**): The first level of the menu.
to the :ref:`display_menu.enter <display_menu-enter_action>` action.
- **items** (**Required**): The first level of the menu.
Automations:
@ -172,7 +174,7 @@ is clicked the display shows the new menu level.
Configuration variables:
- **menu** (**Required**): Defines the child menu items.
- **items** (**Required**): Defines the child menu items.
Automations:

View File

@ -94,12 +94,16 @@ Configuration variables:
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **display_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the LCD display.
- **mark_back**, **mark_selected**, **mark_editing**, **mark_submenu** (*Optional*, 0-255):
Code of the character used to mark menu items going back one level, a selected one,
the editing mode and item leading to a submenu. Defaults to ``0x5e`` (``^``), ``0x3e`` (``>``),
``0x2a`` (``*``) and ``0x7e`` (a right arrow). As the character set lacks a good looking
back arrow, using a user defined character is advisable for ``mark_back`` (use ``8`` to
reference one at position ``0`` to avoid problems with zeros in a string).
- **mark_back** (*Optional*, 0-255): Code of the character used to mark menu items going back
one level. As the character set lacks a good looking back arrow, using a user defined character
is advisable (use ``8`` to reference one at position ``0`` to avoid problems with zeros
in a string). Defaults to ``0x5e`` (``^``).
- **mark_selected** (*Optional*, 0-255): Code of the character used to mark menu item selected.
Defaults to ``0x3e`` (``>``).
- **mark_editing** (*Optional*, 0-255): Code of the character used to mark menu item editing mode.
Defaults to ``0x2a`` (``*``).
- **mark_submenu** (*Optional*, 0-255): Code of the character used to mark menu item leading to a
submenu. Defaults to ``0x7e`` (a right arrow).
The rest of the configuration is described in the :ref:`Display Menu <display_menu>` component.
The menu inherits the dimensions of the connected LCD display and uses the entire area.

View File

@ -309,8 +309,8 @@ Configuration options:
``ezo_pmp.dose_volume_over_time`` Action
----------------------------------------
Use this action in an :ref:`automations <automation>` to have the peristaltic pump dose an specific `volume` (in milliliters)
over the provided `duration` (in minutes). At the end of the time period the pump will have dosed the specified `volume`.
Use this action in an :ref:`automations <automation>` to have the peristaltic pump dose an specific ``volume`` (in milliliters)
over the provided ``duration`` (in minutes). At the end of the time period the pump will have dosed the specified ``volume``.
If the volume is negative the pump will run backwards.
.. code-block:: yaml
@ -342,8 +342,8 @@ Configuration options:
``ezo_pmp.dose_with_constant_flow_rate`` Action
-----------------------------------------------
Use this action in an :ref:`automations <automation>` to have the peristaltic pump dose an specific `volume` (in milliliters) every minute
for the provided `duration` (in minutes). At the end of the time period the pump will have dosed the specified `volume` times the `duration`.
Use this action in an :ref:`automations <automation>` to have the peristaltic pump dose an specific ``volume`` (in milliliters) every minute
for the provided ``duration`` (in minutes). At the end of the time period the pump will have dosed the specified ``volume`` times the ``duration``.
If the volume is negative the pump will run backwards.
.. code-block:: yaml

View File

@ -39,24 +39,24 @@ Configuration variables:
- **type** (**Required**): One of ``rssi``, ``characteristic``.
rssi options:
rssi options:
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device.
- All other options from :ref:`Sensor <config-sensor>`.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device.
- All other options from :ref:`Sensor <config-sensor>`.
characteristic options:
characteristic options:
- **ble_client_id** (**Required**, :ref:`config-id`): ID of the associated BLE client.
- **service_uuid** (**Required**, UUID): UUID of the service on the device.
- **characteristic_uuid** (**Required**, UUID): UUID of the service's characteristic to query.
- **descriptor_uuid** (*Optional*, UUID): UUID of the characteristic's descriptor to query.
- **id** (*Optional*, :ref:`config-id`): The ID to use for code generation, and for reference by dependent components.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`): The lambda to use for converting a raw data
- **ble_client_id** (**Required**, :ref:`config-id`): ID of the associated BLE client.
- **service_uuid** (**Required**, UUID): UUID of the service on the device.
- **characteristic_uuid** (**Required**, UUID): UUID of the service's characteristic to query.
- **descriptor_uuid** (*Optional*, UUID): UUID of the characteristic's descriptor to query.
- **id** (*Optional*, :ref:`config-id`): The ID to use for code generation, and for reference by dependent components.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`): The lambda to use for converting a raw data
reading to a sensor value. See :ref:`ble-sensor-lambda` for more information.
- **notify** (*Optional*, boolean): Instruct the server to send notifications for this
- **notify** (*Optional*, boolean): Instruct the server to send notifications for this
characteristic.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device.
- All other options from :ref:`Sensor <config-sensor>`.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device.
- All other options from :ref:`Sensor <config-sensor>`.
Automations:

View File

@ -45,24 +45,27 @@ Configuration variables:
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
.. _evo_callbacks:
Automation triggers:
Callbacks
---------
- **on_led** (*Optional*, :ref:`Action <config-action>`): Triggered when the result of ``get_led_state()`` is ready. The LED
state is provided as a boolean variable named ``x``.
- **on_device_information** (*Optional*, :ref:`Action <config-action>`): Triggered when the result of ``get_device_information()``
is ready. The result is provided as a ``std::string`` variable named ``x``.
- **on_slope** (*Optional*, :ref:`Action <config-action>`): Triggered when the result of ``get_slope()`` is ready. The result
is provided as a ``std::string`` variable named ``x``.
- **on_calibration** (*Optional*, :ref:`Action <config-action>`): Triggered when the result of ``get_calibration()`` is ready.
The result is provided as a ``std::string`` variable named ``x``.
- **on_t** (*Optional*, :ref:`Action <config-action>`): Triggered when the result of ``get_t()`` is ready. The result is provided
as a ``std::string`` variable named ``x``.
- **on_custom** (*Optional*, :ref:`Action <config-action>`): Triggered when the result of ``get_custom()`` is ready. The result is provided as a ``std::string`` variable named ``x``.
- **on_led:** : Triggered when the result of ``get_led_state()`` is ready. The LED state is provided as a boolean variable named ``x``.
- **on_device_information:** : Triggered when the result of ``get_device_information()`` is ready. The result is provided as a ``std::string`` variable named ``x``.
- **on_slope:** : Triggered when the result of ``get_slope()`` is ready. The result is provided as a ``std::string`` variable named ``x``.
- **on_calibration:** : Triggered when the result of ``get_calibration()`` is ready. The result is provided as a ``std::string`` variable named ``x``.
- **on_t:** : Triggered when the result of ``get_t()`` is ready. The result is provided as a ``std::string`` variable named ``x``.
- **on_custom:** : Triggered when the result of ``get_custom()`` is ready. The result is provided as a ``std::string`` variable named ``x``.
.. _ezo_lambda_calls:
.. _evo_lambda_calls:
lambda calls
Lambda calls
------------
From :ref:`lambdas <config-lambda>`, you can interact with the sensor in various ways. For any ``get`` command a trigger will be called with the information retrieved from the sensor. See :ref:`evo_callbacks`. For more information on the command specifics, refer to the datasheet.
From :ref:`lambdas <config-lambda>`, you can interact with the sensor in various ways. For any ``get`` command a trigger will be called
with the information retrieved from the sensor. For more information on the command specifics, refer to the datasheet.
- ``set_i2c(uint8_t address)``: Set I2C address of the device, must be an integer between 1 and 127

View File

@ -35,19 +35,19 @@ Configuration variables:
The MPL3115A2 can be configured to output either pressure or altitude depending on which
sensor is configured.
- **pressure** (**Optional**): The information for the pressure sensor.
- **pressure** (*Optional*): The information for the pressure sensor.
- **name** (**Required**, string): The name for the pressure sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **altitude** (**Optional**): The information for the altitude sensor.
- **altitude** (*Optional*): The information for the altitude sensor.
- **name** (**Required**, string): The name for the altitude sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **temperature** (**Optional**): The information for the temperature sensor.
- **temperature** (*Optional*): The information for the temperature sensor.
- **name** (**Required**, string): The name for the temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.

View File

@ -32,7 +32,7 @@ linked to the uFire EC configuration.
Configuration variables:
------------------------
- **address** (**Optional**, int): Specify the I²C address of the sensor. Defaults to ``0x3C``.
- **address** (*Optional*, int): Specify the I²C address of the sensor. Defaults to ``0x3C``.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
@ -47,8 +47,8 @@ Configuration variables:
.. _sensor-ufire_ec-calibrate_probe_action:
``sensor.ufire_ec.calibrate_probe`` Action
------------------------------------------
``ufire_ec.calibrate_probe`` Action
-----------------------------------
The EC probe have to be calibrated. For this you need know the EC reference value and temperature
of the calibration solution.
@ -76,8 +76,8 @@ Configuration options:
.. _sensor-ufire_ec-reset_action:
``sensor.ufire_ec.reset`` Action
--------------------------------
``ufire_ec.reset`` Action
-------------------------
Reset the current calibration on the sensor.

View File

@ -32,7 +32,7 @@ be on the same board or external sensor linked to the uFire ISE pH configuration
Configuration variables:
------------------------
- **address** (**Optional**, int): Specify the I²C address of the sensor. Defaults to ``0x3f``.
- **address** (*Optional*, int): Specify the I²C address of the sensor. Defaults to ``0x3f``.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
@ -44,8 +44,8 @@ Configuration variables:
.. _sensor-ufire_ise-calibrate_probe_high_action:
``sensor.ufire_ise.calibrate_probe_high`` Action
------------------------------------------------
``ufire_ise.calibrate_probe_high`` Action
-----------------------------------------
The pH probe have to be calibrated. For this you need know the pH reference value and temperature
of the calibration high solution.
@ -69,12 +69,11 @@ Configuration options:
- **id** (**Required**, :ref:`config-id`): The ID of the ufire pH sensor.
- **solution** (**Required**, float): Solution reference pH value.
- **temperature** (**Required**, float): Solution current temperature.
.. _sensor-ufire_ise-calibrate_probe_low_action:
``sensor.ufire_ise.calibrate_probe_low`` Action
-----------------------------------------------
``ufire_ise.calibrate_probe_low`` Action
----------------------------------------
The pH probe have to be calibrated. For this you need know the pH reference value and temperature
of the calibration low solution.
@ -98,12 +97,11 @@ Configuration options:
- **id** (**Required**, :ref:`config-id`): The ID of the ufire pH sensor.
- **solution** (**Required**, float): Solution reference pH value.
- **temperature** (**Required**, float): Solution current temperature.
.. _sensor-ufire_ise-reset_action:
``sensor.ufire_ise.reset`` Action
---------------------------------
``ufire_ise.reset`` Action
--------------------------
Reset the current calibration on the sensor.

View File

@ -183,6 +183,17 @@ CUSTOM_DOCS = {
"components/display/ssd1327": {"_LoadSchema": False},
"components/display/ssd1351": {"_LoadSchema": False},
"components/copy": {"_LoadSchema": False},
"components/display_menu/index": {
"Display Menu": "display_menu_base.schemas.DISPLAY_MENU_BASE_SCHEMA",
"Select": "display_menu_base.schemas.MENU_TYPES.schema.config_vars.items.types.select",
"Menu": "display_menu_base.schemas.MENU_TYPES.schema.config_vars.items.types.menu",
"Number": "display_menu_base.schemas.MENU_TYPES.schema.config_vars.items.types.number",
"Switch": "display_menu_base.schemas.MENU_TYPES.schema.config_vars.items.types.switch",
"Custom": "display_menu_base.schemas.MENU_TYPES.schema.config_vars.items.types.custom",
},
"components/display_menu/lcd_menu": {
"LCD Menu": "lcd_menu.schemas.CONFIG_SCHEMA",
},
}
@ -226,6 +237,18 @@ class SchemaGeneratorVisitor(nodes.NodeVisitor):
self.json_component = self.file_schema[self.component]["schemas"][
"CONFIG_SCHEMA"
]
elif self.path[1] == "display_menu": # weird folder naming
if self.path[2] == "index":
# weird component name mismatch
self.component = "display_menu_base"
else:
self.component = self.path[2]
self.file_schema = get_component_file(app, self.component)
self.json_component = self.file_schema[self.component]["schemas"][
"CONFIG_SCHEMA"
]
else: # sub component, e.g. output/esp8266_pwm
# components here might have a core / hub, eg. dallas, ads1115
@ -288,6 +311,7 @@ class SchemaGeneratorVisitor(nodes.NodeVisitor):
elif componentName in core["platforms"]:
core["platforms"][componentName]["docs"] = description
else:
if componentName != "display_menu_base":
raise ValueError(
"Cannot set description for component " + componentName
)
@ -1156,8 +1180,8 @@ def handle_component(app, doctree, docname):
elif docname not in CUSTOM_DOCS:
return
v = SchemaGeneratorVisitor(app, doctree, docname)
try:
v = SchemaGeneratorVisitor(app, doctree, docname)
doctree.walkabout(v)
except Exception as e:
err_str = f"In {docname}.rst: {str(e)}"