mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	[remote_receiver] Add better error message for tolerance breaking change (#6784)
This commit is contained in:
		| @@ -63,7 +63,13 @@ def validate_tolerance(value): | |||||||
|     if "%" in str(value): |     if "%" in str(value): | ||||||
|         type_ = TYPE_PERCENTAGE |         type_ = TYPE_PERCENTAGE | ||||||
|     else: |     else: | ||||||
|         type_ = TYPE_TIME |         try: | ||||||
|  |             cv.positive_time_period_microseconds(value) | ||||||
|  |             type_ = TYPE_TIME | ||||||
|  |         except cv.Invalid as exc: | ||||||
|  |             raise cv.Invalid( | ||||||
|  |                 "Tolerance must be a percentage or time. Configurations made before 2024.5.0 treated the value as a percentage." | ||||||
|  |             ) from exc | ||||||
|  |  | ||||||
|     return TOLERANCE_SCHEMA( |     return TOLERANCE_SCHEMA( | ||||||
|         { |         { | ||||||
|   | |||||||
| @@ -3,6 +3,7 @@ remote_receiver: | |||||||
|   pin: ${pin} |   pin: ${pin} | ||||||
|   rmt_channel: ${rmt_channel} |   rmt_channel: ${rmt_channel} | ||||||
|   dump: all |   dump: all | ||||||
|  |   tolerance: 25% | ||||||
|   on_abbwelcome: |   on_abbwelcome: | ||||||
|     then: |     then: | ||||||
|       - logger.log: |       - logger.log: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user