Convert pin mode examples to new format (#1591)

This commit is contained in:
Jesse Hills 2021-11-04 07:55:26 +13:00 committed by GitHub
parent 400bdeb615
commit 1f8ecd46a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 182 additions and 70 deletions

View File

@ -44,7 +44,9 @@ you can do so with the :ref:`Pin Schema <config-pin_schema>`.
- platform: gpio
pin:
number: D2
mode: INPUT_PULLUP
mode:
input: true
pullup: true
name: ...
Inverting Values

View File

@ -126,7 +126,9 @@ IR receiver.
pin:
number: GPIO14
inverted: true
mode: INPUT_PULLUP
mode:
input: true
pullup: true
# high 55% tolerance is recommended for some remote control units
tolerance: 55%

View File

@ -201,7 +201,9 @@ appropriate lines of C code in the lambda to hide or show the image or text as y
pin:
number: GPIO0
inverted: true
mode: INPUT_PULLUP
mode:
input: true
pullup: true
name: "T-Display Button Input 0"
id: tdisplay_button_input_0
- platform: gpio

View File

@ -36,7 +36,8 @@ The MCP23008 component (`datasheet <http://ww1.microchip.com/downloads/en/device
mcp23xxx: mcp23008_hub
# Use pin number 0
number: 0
mode: OUTPUT
mode:
output: true
inverted: false
# Individual inputs
@ -48,7 +49,8 @@ The MCP23008 component (`datasheet <http://ww1.microchip.com/downloads/en/device
# Use pin number 1
number: 1
# One of INPUT or INPUT_PULLUP
mode: INPUT
mode:
input: true
inverted: false
Configuration variables:
@ -98,7 +100,8 @@ has 16 GPIOs and can be configured the same way than the other variants.
mcp23016: mcp23016_hub
# Use pin number 0
number: 0
mode: OUTPUT
mode:
output: true
inverted: false
# Individual inputs
@ -109,7 +112,8 @@ has 16 GPIOs and can be configured the same way than the other variants.
mcp23016: mcp23016_hub
# Use pin number 1
number: 1
mode: INPUT
mode:
input: true
inverted: false
@ -157,7 +161,8 @@ binary sensor or GPIO switch.
mcp23xxx: mcp23017_hub
# Use pin number 0
number: 0
mode: OUTPUT
mode:
output: true
inverted: false
# Individual inputs
@ -169,7 +174,9 @@ binary sensor or GPIO switch.
# Use pin number 1
number: 1
# One of INPUT or INPUT_PULLUP
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
Configuration variables:

View File

@ -38,7 +38,8 @@ The MCP23S08 component (`datasheet <http://ww1.microchip.com/downloads/en/Device
# Use pin number 0
number: 0
# One of INPUT, INPUT_PULLUP or OUTPUT
mode: OUTPUT
mode:
output: true
inverted: false
# Individual inputs
@ -50,7 +51,8 @@ The MCP23S08 component (`datasheet <http://ww1.microchip.com/downloads/en/Device
# Use pin number 1
number: 1
# One of INPUT or INPUT_PULLUP
mode: INPUT
mode:
input: true
inverted: false
Configuration variables:
@ -103,7 +105,8 @@ binary sensor or GPIO switch.
mcp23xxx: mcp23s17_hub
# Use pin number 0
number: 0
mode: OUTPUT
mode:
output: true
inverted: false
# Individual inputs
@ -115,7 +118,9 @@ binary sensor or GPIO switch.
# Use pin number 1
number: 1
# One of INPUT or INPUT_PULLUP
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
Configuration variables:

View File

@ -37,7 +37,8 @@ for example the `RobotDyn dimmer
gate_pin: D7
zero_cross_pin:
number: D6
mode: INPUT
mode:
input: true
inverted: yes
light:

View File

@ -43,7 +43,8 @@ not work.
# Use pin number 0
number: 0
# One of INPUT or OUTPUT
mode: OUTPUT
mode:
output: true
inverted: false
Configuration variables:

View File

@ -260,7 +260,9 @@ Remote code selection (exactly one of these has to be included):
pin:
number: D4
inverted: true
mode: INPUT_PULLUP
mode:
input: true
pullup: true
dump: all

View File

@ -151,7 +151,9 @@ The outputs can in turn be used to add PWM-enabled lights like the monochromatic
sx1509: sx1509_hub1
# Use pin number 0 on the SX1509
number: 0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
# Individual binary outputs
@ -163,7 +165,8 @@ The outputs can in turn be used to add PWM-enabled lights like the monochromatic
# Use pin number 1 on the SX1509
number: 1
# use as output for switch
mode: OUTPUT
mode:
output: true
inverted: false
# Individual outputs

View File

@ -147,7 +147,9 @@ which these adaptions created by `@cryptelli <https://community.home-assistant.i
- platform: gpio
pin:
number: 14
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Power Button"
on_press:
@ -202,7 +204,9 @@ which these adaptions created by `@cryptelli <https://community.home-assistant.i
- platform: gpio
pin:
number: GPIO13
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Power Button"
on_press:
@ -321,7 +325,9 @@ Check the following page for calibrating the measurements: :ref:`sensor-filter-c
- platform: gpio
pin:
number: 14
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Power Button"
on_press:
@ -398,13 +404,13 @@ Check the following page for calibrating the measurements: :ref:`sensor-filter-c
name: "${plug_name}_Relay"
pin: GPIO14
restore_mode: ALWAYS_ON
id: relay
id: relay
on_turn_on:
- switch.turn_on: red_led
- switch.turn_on: red_led
on_turn_off:
- switch.turn_off: red_led
- switch.turn_off: red_led
sensor:
- platform: hlw8012
@ -474,7 +480,9 @@ Check the following page for calibrating the measurements: :ref:`sensor-filter-c
- platform: gpio
pin:
number: 14
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "${item_name}_button"
on_press:
@ -513,7 +521,7 @@ Check the following page for calibrating the measurements: :ref:`sensor-filter-c
- platform: wifi_signal
name: "${item_name}_wifi_signal"
update_interval: 60s
4. Adding to Home Assistant
---------------------------

View File

@ -57,7 +57,7 @@ and calculating the current with `Ohm's law <https://en.wikipedia.org/wiki/Ohm%2
# D7 GPIO13 | HLW8012/CF | cf_pin
status_led:
pin:
pin:
number: GPIO5
output:
@ -83,7 +83,9 @@ and calculating the current with `Ohm's law <https://en.wikipedia.org/wiki/Ohm%2
id: button1
pin:
number: GPIO14
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
on_press:
- switch.toggle: switch1

View File

@ -13,7 +13,7 @@ firmware can be uploaded allowing you to control the Wifi Smart Fish Feeder via
Wifi Smart Fish Feeder Configuration
------------------------------------
Thanks to the amazing `Tasmota template <https://templates.blakadder.com/ilonda_L88.html>`__,
Thanks to the amazing `Tasmota template <https://templates.blakadder.com/ilonda_L88.html>`__,
managed to build a fully working esphome configuration. This assumes you have a secret.yaml with ssid and password keys.
.. code-block:: yaml
@ -39,7 +39,9 @@ managed to build a fully working esphome configuration. This assumes you have a
id: button
pin:
number: GPIO4
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: True
name: 'Switch feeder'
on_press:

View File

@ -117,7 +117,9 @@ Now you have a pair of wires from the GPIO and 0V to your retractive switch lets
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button_1
on_press:

View File

@ -97,7 +97,9 @@ The R1 version of the Dual controls the relays via the UART, so the code gets a
- platform: gpio
pin:
number: GPIO4
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button_1
on_press:
@ -107,7 +109,9 @@ The R1 version of the Dual controls the relays via the UART, so the code gets a
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button_2
on_press:
@ -196,7 +200,9 @@ It's basically the same as the :doc:`T2 </cookbook/sonoff-t1-3>`
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button
on_press:
@ -206,7 +212,9 @@ It's basically the same as the :doc:`T2 </cookbook/sonoff-t1-3>`
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button
on_press:

View File

@ -115,7 +115,9 @@ Here is the configuration with the basic operations outlined above.
name: "esp_fishpond_gpio14"
pin:
number: 14
mode: INPUT_PULLUP
mode:
input: true
pullup: true
on_press:
- switch.turn_off: esp_fishpond_pump

View File

@ -36,7 +36,9 @@ T1
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button_1
on_press:
@ -99,7 +101,9 @@ T2
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button_1
on_press:
@ -109,7 +113,9 @@ T2
- platform: gpio
pin:
number: GPIO9
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button_2
on_press:
@ -170,7 +176,9 @@ T3
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button_1
on_press:
@ -180,7 +188,9 @@ T3
- platform: gpio
pin:
number: GPIO9
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button_2
on_press:
@ -190,7 +200,9 @@ T3
- platform: gpio
pin:
number: GPIO10
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
id: button_3
on_press:
@ -241,4 +253,3 @@ See Also
- :doc:`/cookbook/sonoff-light-switch`
- :doc:`/guides/automations`
- :doc:`/devices/sonoff_t1_uk_3gang_v1.1`

View File

@ -243,25 +243,33 @@ of the basic functions.
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff 4CH Button 1"
- platform: gpio
pin:
number: GPIO9
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff 4CH Button 2"
- platform: gpio
pin:
number: GPIO10
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff 4CH Button 3"
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff 4CH Button 4"
- platform: status

View File

@ -17,7 +17,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff 4CH Button 1"
on_press:
@ -25,7 +27,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO9
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff 4CH Button 2"
on_press:
@ -33,7 +37,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO10
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff 4CH Button 3"
on_press:
@ -41,7 +47,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff 4CH Button 4"
on_press:

View File

@ -70,7 +70,9 @@ exposes all of the basic functions.
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff Basic Button"
on_press:

View File

@ -225,7 +225,9 @@ of the basic functions.
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff S20 Button"
- platform: status

View File

@ -18,7 +18,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff S20 Button"
on_press:

View File

@ -246,19 +246,25 @@ of the basic functions.
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T1 UK 3 Gang Touchpad 1"
- platform: gpio
pin:
number: GPIO9
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T1 UK 3 Gang Touchpad 2"
- platform: gpio
pin:
number: GPIO10
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T1 UK 3 Gang Touchpad 3"
- platform: status

View File

@ -24,7 +24,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T1 UK 3 Gang Touchpad 1"
on_press:
@ -32,7 +34,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO9
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T1 UK 3 Gang Touchpad 2"
on_press:
@ -40,7 +44,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO10
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T1 UK 3 Gang Touchpad 3"
on_press:

View File

@ -250,19 +250,25 @@ of the basic functions.
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T3 EU 3 Gang Touchpad 1"
- platform: gpio
pin:
number: GPIO9
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T3 EU 3 Gang Touchpad 2"
- platform: gpio
pin:
number: GPIO10
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T3 EU 3 Gang Touchpad 3"
- platform: status

View File

@ -24,7 +24,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T3 EU 3 Gang Touchpad 1"
on_press:
@ -32,7 +34,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO9
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T3 EU 3 Gang Touchpad 2"
on_press:
@ -40,7 +44,9 @@ binary_sensor:
- platform: gpio
pin:
number: GPIO10
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
name: "Sonoff T3 EU 3 Gang Touchpad 3"
on_press:

View File

@ -21,7 +21,9 @@ binary_sensor:
name: "Teckin Button"
pin:
number: GPIO1
mode: INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
on_press:
- switch.toggle: relay

View File

@ -19,7 +19,7 @@ Installing ESPHome is very easy. All you need to do is have `Python
.. note::
Python 3.7 or above is required to install ESPHome 1.18.0 or above.
.. code-block:: bash
@ -127,7 +127,9 @@ Sensor </components/binary_sensor/gpio>`.
pin:
number: 16
inverted: true
mode: INPUT_PULLUP
mode:
input: true
pullup: true
This is an advanced feature of ESPHome. Almost all pins can
optionally have a more complicated configuration schema with options for

View File

@ -133,7 +133,9 @@ Sensor </components/binary_sensor/gpio>`.
pin:
number: 16
inverted: true
mode: INPUT_PULLUP
mode:
input: true
pullup: true
This time when installing, you dont need to have the device plugged in
through USB again. The upload will happen wirelessly (:doc:`"over the air" </components/ota>`).