1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 05:12:21 +01:00

remote updates

This commit is contained in:
Otto Winter
2019-05-13 20:45:22 +02:00
parent 5bb963fa82
commit 60d67e5428
12 changed files with 88 additions and 25 deletions

View File

@@ -227,6 +227,11 @@ def int_(value):
check_not_templatable(value)
if isinstance(value, integer_types):
return value
if isinstance(value, float):
if int(value) == value:
return int(value)
raise Invalid("This option only accepts integers with no fractional part. Please remove "
"the fractional part from {}".format(value))
value = string_strict(value).lower()
base = 10
if value.startswith('0x'):