#NEWLINE# def __init__( self , address = 39 , busnum = None , i2c = None , **kwargs ) : #NEWLINE# #INDENT# address = int ( address ) #NEWLINE# self . __name__ = ( 'PCF8574' if ( address in range ( 32 , 40 ) ) else ( 'PCF8574A' if ( address in range ( 56 , 64 ) ) else ( 'Bad address for PCF8574(A): 0x%02X not in range [0x20..0x27, 0x38..0x3F]' % address ) ) ) #NEWLINE# if ( self . __name__ [ 0 ] != 'P' ) : #NEWLINE# #INDENT# raise ValueError ( self . __name__ ) #NEWLINE# #UNINDENT# i2c = ( i2c or I2C ) #NEWLINE# busnum = ( busnum or i2c . get_default_bus ( ) ) #NEWLINE# self . _device = i2c . get_i2c_device ( address , busnum , ** kwargs ) #NEWLINE# self . iodir = 255 #NEWLINE# self . gpio = 0 #NEWLINE# self . _write_pins ( )