Remove unused polling_component_schema from modbus number (#3108)

This commit is contained in:
Martin 2022-01-24 20:44:20 +01:00 committed by GitHub
parent 7cb6729fa7
commit 6b27f2d2cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 11 deletions

View file

@ -58,8 +58,7 @@ def validate_modbus_number(config):
CONFIG_SCHEMA = cv.All( CONFIG_SCHEMA = cv.All(
number.NUMBER_SCHEMA.extend(ModbusItemBaseSchema) number.NUMBER_SCHEMA.extend(ModbusItemBaseSchema).extend(
.extend(
{ {
cv.GenerateID(): cv.declare_id(ModbusNumber), cv.GenerateID(): cv.declare_id(ModbusNumber),
cv.Optional(CONF_VALUE_TYPE, default="U_WORD"): cv.enum(SENSOR_VALUE_TYPE), cv.Optional(CONF_VALUE_TYPE, default="U_WORD"): cv.enum(SENSOR_VALUE_TYPE),
@ -72,8 +71,7 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_MULTIPLY, default=1.0): cv.float_, cv.Optional(CONF_MULTIPLY, default=1.0): cv.float_,
cv.Optional(CONF_USE_WRITE_MULTIPLE, default=False): cv.boolean, cv.Optional(CONF_USE_WRITE_MULTIPLE, default=False): cv.boolean,
} }
) ),
.extend(cv.polling_component_schema("60s")),
validate_min_max, validate_min_max,
validate_modbus_number, validate_modbus_number,
) )

View file

@ -14,8 +14,8 @@ esp32:
wifi: wifi:
networks: networks:
- ssid: 'MySSID' - ssid: "MySSID"
password: 'password1' password: "password1"
manual_ip: manual_ip:
static_ip: 192.168.1.23 static_ip: 192.168.1.23
gateway: 192.168.1.1 gateway: 192.168.1.1
@ -39,7 +39,6 @@ uart:
i2c: i2c:
modbus: modbus:
uart_id: uart1 uart_id: uart1
flow_control_pin: 5 flow_control_pin: 5
@ -50,13 +49,20 @@ modbus_controller:
address: 0x2 address: 0x2
modbus_id: mod_bus1 modbus_id: mod_bus1
binary_sensor: binary_sensor:
- platform: gpio - platform: gpio
pin: GPIO0 pin: GPIO0
id: io0_button id: io0_button
icon: mdi:gesture-tap-button icon: mdi:gesture-tap-button
- platform: modbus_controller
modbus_controller_id: modbus_controller_test
id: modbus_binsensortest
register_type: read
address: 0x3200
bitmask: 0x80 #(bit 8)
lambda: !lambda "{ return x ;}"
tlc5947: tlc5947:
data_pin: GPIO12 data_pin: GPIO12
clock_pin: GPIO14 clock_pin: GPIO14
@ -75,6 +81,14 @@ output:
- platform: mcp47a1 - platform: mcp47a1
id: output_mcp47a1 id: output_mcp47a1
- platform: modbus_controller
modbus_controller_id: modbus_controller_test
id: modbus_output_test
lambda: |-
return x * 1.0 ;
address: 0x9001
value_type: U_WORD
demo: demo:
esp32_ble: esp32_ble:
@ -104,9 +118,20 @@ number:
max_value: 100 max_value: 100
min_value: 0 min_value: 0
step: 5 step: 5
unit_of_measurement: '%' unit_of_measurement: "%"
mode: slider mode: slider
- id: modbus_numbertest
platform: modbus_controller
modbus_controller_id: modbus_controller_test
name: "ModbusNumber"
address: 0x9002
value_type: U_WORD
lambda: "return x * 1.0; "
write_lambda: |-
return x * 1.0 ;
multiply: 1.0
select: select:
- platform: template - platform: template
name: My template select name: My template select
@ -170,8 +195,7 @@ sensor:
name: "SelecEM2M Maximum Demand Apparent Power" name: "SelecEM2M Maximum Demand Apparent Power"
disabled_by_default: true disabled_by_default: true
- id: battery_voltage - id: modbus_sensortest
name: "Battery voltage2"
platform: modbus_controller platform: modbus_controller
modbus_controller_id: modbus_controller_test modbus_controller_id: modbus_controller_test
address: 0x331A address: 0x331A
@ -200,6 +224,14 @@ script:
then: then:
- logger.log: "looping!" - logger.log: "looping!"
switch:
- platform: modbus_controller
modbus_controller_id: modbus_controller_test
id: modbus_switch_test
register_type: coil
address: 2
bitmask: 1
ektf2232: ektf2232:
interrupt_pin: GPIO36 interrupt_pin: GPIO36
rts_pin: GPIO5 rts_pin: GPIO5