Skip to content

Commit

Permalink
bugfix: pass keyword arguments instead of arguments
Browse files Browse the repository at this point in the history
fixes #23
  • Loading branch information
trombik committed Mar 29, 2022
1 parent 2db6c39 commit 29cf962
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ to the device when you have multiple WiFi APs.
than 3 days.
* For `esp32c3`, `framework` must be `esp-idf`
(see [config/ping-esp32c3.yaml](config/ping-esp32c3.yaml))
* Requires `esphome` `2022.3.0` due to a breaking change

## Requirements

Expand Down
20 changes: 10 additions & 10 deletions components/ping/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ def validate_timeout(n):
cv.Optional(CONF_TIMEOUT, default="1sec"): cv.positive_time_period_milliseconds,
cv.Optional(CONF_NUM_ATTEMPTS, default=13): cv.int_range(min=1, max=60),
cv.Optional(CONF_LOSS): sensor.sensor_schema(
UNIT_PERCENT,
ICON_EMPTY,
0,
DEVICE_CLASS_EMPTY,
STATE_CLASS_MEASUREMENT,
unit_of_measurement=UNIT_PERCENT,
icon=ICON_EMPTY,
accuracy_decimals=0,
device_class=DEVICE_CLASS_EMPTY,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_LATENCY): sensor.sensor_schema(
UNIT_SECOND,
ICON_EMPTY,
0,
DEVICE_CLASS_EMPTY,
STATE_CLASS_MEASUREMENT,
unit_of_measurement=UNIT_SECOND,
icon=ICON_EMPTY,
accuracy_decimals=0,
device_class=DEVICE_CLASS_EMPTY,
state_class=STATE_CLASS_MEASUREMENT,
),
}
).extend(cv.polling_component_schema("60s"))
Expand Down

0 comments on commit 29cf962

Please sign in to comment.