From bf36c321f6c1c2e827d89725106584ea54ad3aaf Mon Sep 17 00:00:00 2001
From: Benji <46675043+BenjiU@users.noreply.github.com>
Date: Sun, 5 Jul 2020 20:50:31 +0200
Subject: [PATCH] Update mcp3008.py

---
 pi_mqtt_gpio/modules/mcp3008.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pi_mqtt_gpio/modules/mcp3008.py b/pi_mqtt_gpio/modules/mcp3008.py
index a06fb4f..18c583a 100644
--- a/pi_mqtt_gpio/modules/mcp3008.py
+++ b/pi_mqtt_gpio/modules/mcp3008.py
@@ -49,7 +49,7 @@ class Sensor(GenericSensor):
         _LOG.warning("MCP3008: Reading from channel %r", channel)
         if channel == "invalid":
             raise Exception("Channel '" + config["channel"] + "' not found!")
-        value = self.mcp.read_adc(i)
+        value = self.mcp.read_adc(channel)
         _LOG.warning("MCP3008: value %d", value)
         return value
 
-- 
GitLab