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(
number.NUMBER_SCHEMA.extend(ModbusItemBaseSchema)
.extend(
number.NUMBER_SCHEMA.extend(ModbusItemBaseSchema).extend(
{
cv.GenerateID(): cv.declare_id(ModbusNumber),
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_USE_WRITE_MULTIPLE, default=False): cv.boolean,
}
)
.extend(cv.polling_component_schema("60s")),
),
validate_min_max,
validate_modbus_number,
)

View file

@ -14,8 +14,8 @@ esp32:
wifi:
networks:
- ssid: 'MySSID'
password: 'password1'
- ssid: "MySSID"
password: "password1"
manual_ip:
static_ip: 192.168.1.23
gateway: 192.168.1.1
@ -39,7 +39,6 @@ uart:
i2c:
modbus:
uart_id: uart1
flow_control_pin: 5
@ -50,13 +49,20 @@ modbus_controller:
address: 0x2
modbus_id: mod_bus1
binary_sensor:
- platform: gpio
pin: GPIO0
id: io0_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:
data_pin: GPIO12
clock_pin: GPIO14
@ -75,6 +81,14 @@ output:
- platform: 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:
esp32_ble:
@ -104,9 +118,20 @@ number:
max_value: 100
min_value: 0
step: 5
unit_of_measurement: '%'
unit_of_measurement: "%"
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:
- platform: template
name: My template select
@ -170,8 +195,7 @@ sensor:
name: "SelecEM2M Maximum Demand Apparent Power"
disabled_by_default: true
- id: battery_voltage
name: "Battery voltage2"
- id: modbus_sensortest
platform: modbus_controller
modbus_controller_id: modbus_controller_test
address: 0x331A
@ -200,6 +224,14 @@ script:
then:
- 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:
interrupt_pin: GPIO36
rts_pin: GPIO5