Skip to content

Commit c8b90d3

Browse files
committed
Fix a bug in Sensor.value() function
1 parent 2da6774 commit c8b90d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ev3dev/ev3dev.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,14 +1149,14 @@ def units(self):
11491149

11501150
#~autogen
11511151

1152-
def value(self, n):
1152+
def value(self, n=0):
11531153
if True == isinstance( n, numbers.Integral ):
11541154
n = '{0:d}'.format( n )
11551155
elif True == isinstance( n, numbers.Real ):
11561156
n = '{0:.0f}'.format( n )
11571157

11581158
if True == isinstance( n, str ):
1159-
return self._device._get_int_attribute( 'value'+n, 'value'+n )
1159+
return self.get_attr_int( 'value'+n )
11601160
else:
11611161
return 0
11621162

0 commit comments

Comments
 (0)