Browse Source

renamed _gpio.read to _gpio.input

digital 8 years ago
parent
commit
8da626ec33
1 changed files with 7 additions and 6 deletions
  1. 7 6
      pin/__init__.py

+ 7 - 6
pin/__init__.py

@@ -85,9 +85,9 @@ class GPIOWrapper(object):
             lgpio.debug("no gpio module")
         lgpio.debug("gpio module: {}".format(self.gpio))
 
-    def read(self,pin,*args):
+    def input(self,pin,*args):
         if self.gpio:
-            state = self.gpio.read(pin)
+            state = self.gpio.input(pin)
         else:
             state = -1
         lgpio.debug("reading pin {:0>2}: {}".format(
@@ -116,8 +116,8 @@ class PinBase(object):
         self.value = value
         _gpio.output(self.pin_number,value)
 
-    def read(self):
-        value = _gpio.read(self.pin_number,value)
+    def input(self):
+        value = _gpio.input(self.pin_number,value)
         return value
 
 class DigitalPin(PinBase):
@@ -320,14 +320,15 @@ class DebugPinController(PinControllerBase):
         pins = digilib.misc.parse_to_int_list(args[0])
         [state] = digilib.misc.parse_to_int_list(args[1])
         _gpio.output(pins,state)
-    def read(self,args=[],command=None,respond=None):
+
+    def input(self,args=[],command=None,respond=None):
         if len(args) != 2:
             respond(ERROR_TAKES_ARGUMENTS.format(
                     command, "two", "positional", "<name>"))
             return False
         pins = digilib.misc.parse_to_int_list(args[0])
         [state] = digilib.misc.parse_to_int_list(args[1])
-        return _gpio.read(pins,state)
+        return _gpio.input(pins,state)
 
 if __name__ == "__main__":
     pass