From d074bc28190fccffbdcbca6e73eb1bbec1fae6c1 Mon Sep 17 00:00:00 2001 From: haudamekki <38363966+haudamekki@users.noreply.github.com> Date: Thu, 31 Oct 2024 08:08:25 +0100 Subject: [PATCH] Update esphome/components/gp8211/gp8211.cpp Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/components/gp8211/gp8211.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/esphome/components/gp8211/gp8211.cpp b/esphome/components/gp8211/gp8211.cpp index b35af96838..f74bdadebd 100644 --- a/esphome/components/gp8211/gp8211.cpp +++ b/esphome/components/gp8211/gp8211.cpp @@ -9,8 +9,7 @@ static const char *const TAG = "gp8211"; static const uint8_t RANGE_REGISTER = 0x01; void GP8211::setup() { - uint8_t voltage_setting = (this->voltage_ == GP8211_VOLTAGE_10V) ? 0x77 : 0x55; - this->write_register(RANGE_REGISTER, &voltage_setting, 1); + this->write_register(RANGE_REGISTER, &this->voltage_, 1); } void GP8211::dump_config() {