mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Allow duration for deep_sleep.enter to be templateable (#1765)
This commit is contained in:
		| @@ -108,7 +108,9 @@ def to_code(config): | ||||
| DEEP_SLEEP_ENTER_SCHEMA = automation.maybe_simple_id( | ||||
|     { | ||||
|         cv.GenerateID(): cv.use_id(DeepSleepComponent), | ||||
|         cv.Optional(CONF_SLEEP_DURATION): cv.positive_time_period_milliseconds, | ||||
|         cv.Optional(CONF_SLEEP_DURATION): cv.templatable( | ||||
|             cv.positive_time_period_milliseconds | ||||
|         ), | ||||
|     } | ||||
| ) | ||||
|  | ||||
|   | ||||
| @@ -346,6 +346,8 @@ text_sensor: | ||||
|       - homeassistant.tag_scanned: 1234-abcd | ||||
|       - deep_sleep.enter: | ||||
|           sleep_duration: 30min | ||||
|       - deep_sleep.enter: | ||||
|           sleep_duration: !lambda "return 30 * 60 * 1000;" | ||||
|   - platform: template | ||||
|     name: 'Template Text Sensor' | ||||
|     lambda: |- | ||||
|   | ||||
		Reference in New Issue
	
	Block a user