mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Lint
This commit is contained in:
		| @@ -80,7 +80,7 @@ def validate_automation(extra_schema=None, extra_validators=None, single=False): | |||||||
|                 except cv.Invalid as err2: |                 except cv.Invalid as err2: | ||||||
|                     if u'Unable to find action' in str(err): |                     if u'Unable to find action' in str(err): | ||||||
|                         raise err2 |                         raise err2 | ||||||
|                 raise cv.MultipleInvalid([err, err2]) |                     raise cv.MultipleInvalid([err, err2]) | ||||||
|         elif isinstance(value, dict): |         elif isinstance(value, dict): | ||||||
|             if CONF_THEN in value: |             if CONF_THEN in value: | ||||||
|                 return [schema(value)] |                 return [schema(value)] | ||||||
|   | |||||||
| @@ -3,6 +3,7 @@ from __future__ import print_function | |||||||
| import fnmatch | import fnmatch | ||||||
| import functools | import functools | ||||||
| import logging | import logging | ||||||
|  | import math | ||||||
| import os | import os | ||||||
|  |  | ||||||
| import uuid | import uuid | ||||||
| @@ -411,13 +412,10 @@ class ESPHomeDumper(yaml.SafeDumper):  # pylint: disable=too-many-ancestors | |||||||
|     def represent_float(self, value): |     def represent_float(self, value): | ||||||
|         if is_secret(value): |         if is_secret(value): | ||||||
|             return self.represent_secret(value) |             return self.represent_secret(value) | ||||||
|         # pylint: disable=comparison-with-itself |         if math.isnan(value): | ||||||
|         if value != value or (value == 0.0 and value == 1.0): |  | ||||||
|             value = u'.nan' |             value = u'.nan' | ||||||
|         elif value == self.inf_value: |         elif math.isinf(value): | ||||||
|             value = u'.inf' |             value = u'.inf' if value > 0 else u'-.inf' | ||||||
|         elif value == -self.inf_value: |  | ||||||
|             value = u'-.inf' |  | ||||||
|         else: |         else: | ||||||
|             value = text_type(repr(value)).lower() |             value = text_type(repr(value)).lower() | ||||||
|             # Note that in some cases `repr(data)` represents a float number |             # Note that in some cases `repr(data)` represents a float number | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user