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 ``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. on/off and speed control.
When the BedJet is already on, turning the Fan component off will set the BedJet unit's mode to 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. - **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 - **active** (*Optional*, boolean): Whether the menu should start as active, meaning accepting
user interactions and displaying output. Defaults to ``true``. user interactions and displaying output. Defaults to ``true``.
- **mode** (*Optional*, string): Defines the navigation logic. The ``rotary`` mode expects - **mode** (*Optional*, enum): Defines the navigation logic. Defaults to ``rotary``.
the clockwise movement wired to :ref:`display_menu.down <display_menu-down_action>`,
- ``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 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 to :ref:`display_menu.enter <display_menu-enter_action>` action.
expects the up, down, left and right buttons wired to the :ref:`display_menu.up <display_menu-up_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>` :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 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``. to the :ref:`display_menu.enter <display_menu-enter_action>` action.
- **menu** (**Required**): The first level of the menu.
- **items** (**Required**): The first level of the menu.
Automations: Automations:
@ -172,7 +174,7 @@ is clicked the display shows the new menu level.
Configuration variables: Configuration variables:
- **menu** (**Required**): Defines the child menu items. - **items** (**Required**): Defines the child menu items.
Automations: Automations:

View File

@ -94,12 +94,16 @@ Configuration variables:
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - **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. - **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): - **mark_back** (*Optional*, 0-255): Code of the character used to mark menu items going back
Code of the character used to mark menu items going back one level, a selected one, one level. As the character set lacks a good looking back arrow, using a user defined character
the editing mode and item leading to a submenu. Defaults to ``0x5e`` (``^``), ``0x3e`` (``>``), is advisable (use ``8`` to reference one at position ``0`` to avoid problems with zeros
``0x2a`` (``*``) and ``0x7e`` (a right arrow). As the character set lacks a good looking in a string). Defaults to ``0x5e`` (``^``).
back arrow, using a user defined character is advisable for ``mark_back`` (use ``8`` to - **mark_selected** (*Optional*, 0-255): Code of the character used to mark menu item selected.
reference one at position ``0`` to avoid problems with zeros in a string). 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 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. 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 ``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) 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`. 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. If the volume is negative the pump will run backwards.
.. code-block:: yaml .. code-block:: yaml
@ -342,8 +342,8 @@ Configuration options:
``ezo_pmp.dose_with_constant_flow_rate`` Action ``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 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`. 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. If the volume is negative the pump will run backwards.
.. code-block:: yaml .. code-block:: yaml

View File

@ -39,24 +39,24 @@ Configuration variables:
- **type** (**Required**): One of ``rssi``, ``characteristic``. - **type** (**Required**): One of ``rssi``, ``characteristic``.
rssi options: rssi options:
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device. - **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device.
- All other options from :ref:`Sensor <config-sensor>`. - 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. - **ble_client_id** (**Required**, :ref:`config-id`): ID of the associated BLE client.
- **service_uuid** (**Required**, UUID): UUID of the service on the device. - **service_uuid** (**Required**, UUID): UUID of the service on the device.
- **characteristic_uuid** (**Required**, UUID): UUID of the service's characteristic to query. - **characteristic_uuid** (**Required**, UUID): UUID of the service's characteristic to query.
- **descriptor_uuid** (*Optional*, UUID): UUID of the characteristic's descriptor 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. - **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 - **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. 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. characteristic.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device. - **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device.
- All other options from :ref:`Sensor <config-sensor>`. - All other options from :ref:`Sensor <config-sensor>`.
Automations: Automations:

View File

@ -45,24 +45,27 @@ Configuration variables:
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`. - 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``. .. _ezo_lambda_calls:
- **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``.
.. _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 - ``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 The MPL3115A2 can be configured to output either pressure or altitude depending on which
sensor is configured. 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. - **name** (**Required**, string): The name for the pressure sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`. - 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. - **name** (**Required**, string): The name for the altitude sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`. - 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. - **name** (**Required**, string): The name for the temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - **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: 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 - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``. sensor. Defaults to ``60s``.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - **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:
``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 The EC probe have to be calibrated. For this you need know the EC reference value and temperature
of the calibration solution. of the calibration solution.
@ -76,8 +76,8 @@ Configuration options:
.. _sensor-ufire_ec-reset_action: .. _sensor-ufire_ec-reset_action:
``sensor.ufire_ec.reset`` Action ``ufire_ec.reset`` Action
-------------------------------- -------------------------
Reset the current calibration on the sensor. 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: 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 - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``. sensor. Defaults to ``60s``.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - **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:
``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 The pH probe have to be calibrated. For this you need know the pH reference value and temperature
of the calibration high solution. of the calibration high solution.
@ -69,12 +69,11 @@ Configuration options:
- **id** (**Required**, :ref:`config-id`): The ID of the ufire pH sensor. - **id** (**Required**, :ref:`config-id`): The ID of the ufire pH sensor.
- **solution** (**Required**, float): Solution reference pH value. - **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:
``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 The pH probe have to be calibrated. For this you need know the pH reference value and temperature
of the calibration low solution. of the calibration low solution.
@ -98,12 +97,11 @@ Configuration options:
- **id** (**Required**, :ref:`config-id`): The ID of the ufire pH sensor. - **id** (**Required**, :ref:`config-id`): The ID of the ufire pH sensor.
- **solution** (**Required**, float): Solution reference pH value. - **solution** (**Required**, float): Solution reference pH value.
- **temperature** (**Required**, float): Solution current temperature.
.. _sensor-ufire_ise-reset_action: .. _sensor-ufire_ise-reset_action:
``sensor.ufire_ise.reset`` Action ``ufire_ise.reset`` Action
--------------------------------- --------------------------
Reset the current calibration on the sensor. Reset the current calibration on the sensor.

View File

@ -183,6 +183,17 @@ CUSTOM_DOCS = {
"components/display/ssd1327": {"_LoadSchema": False}, "components/display/ssd1327": {"_LoadSchema": False},
"components/display/ssd1351": {"_LoadSchema": False}, "components/display/ssd1351": {"_LoadSchema": False},
"components/copy": {"_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"][ self.json_component = self.file_schema[self.component]["schemas"][
"CONFIG_SCHEMA" "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 else: # sub component, e.g. output/esp8266_pwm
# components here might have a core / hub, eg. dallas, ads1115 # components here might have a core / hub, eg. dallas, ads1115
@ -288,6 +311,7 @@ class SchemaGeneratorVisitor(nodes.NodeVisitor):
elif componentName in core["platforms"]: elif componentName in core["platforms"]:
core["platforms"][componentName]["docs"] = description core["platforms"][componentName]["docs"] = description
else: else:
if componentName != "display_menu_base":
raise ValueError( raise ValueError(
"Cannot set description for component " + componentName "Cannot set description for component " + componentName
) )
@ -1156,8 +1180,8 @@ def handle_component(app, doctree, docname):
elif docname not in CUSTOM_DOCS: elif docname not in CUSTOM_DOCS:
return return
v = SchemaGeneratorVisitor(app, doctree, docname)
try: try:
v = SchemaGeneratorVisitor(app, doctree, docname)
doctree.walkabout(v) doctree.walkabout(v)
except Exception as e: except Exception as e:
err_str = f"In {docname}.rst: {str(e)}" err_str = f"In {docname}.rst: {str(e)}"