diff --git a/esphome/components/sensor/__init__.py b/esphome/components/sensor/__init__.py index ebd4fcc26c..26ddac3464 100644 --- a/esphome/components/sensor/__init__.py +++ b/esphome/components/sensor/__init__.py @@ -258,11 +258,11 @@ def sensor_schema( ): validate_last_reset_type } ) - if last_reset_type_ != LAST_RESET_TYPE_NONE: + if last_reset_type != LAST_RESET_TYPE_NONE: schema = schema.extend( { cv.Optional( - CONF_LAST_RESET_TYPE, default=last_reset_type_ + CONF_LAST_RESET_TYPE, default=last_reset_type ): validate_last_reset_type } )