mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +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): | ||||
|         type_ = TYPE_PERCENTAGE | ||||
|     else: | ||||
|         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( | ||||
|         { | ||||
|   | ||||
| @@ -3,6 +3,7 @@ remote_receiver: | ||||
|   pin: ${pin} | ||||
|   rmt_channel: ${rmt_channel} | ||||
|   dump: all | ||||
|   tolerance: 25% | ||||
|   on_abbwelcome: | ||||
|     then: | ||||
|       - logger.log: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user