def brightness_state(value):
 if (value.data > 0):
  return (((value.data / 99) * 255), STATE_ON)
 else:
  return (0, STATE_OFF)

def brightness_state ( value ) : if ( value . data > 0 ) : return ( ( ( value . data / 99 ) * 255 ) , STATE_ON ) else : return ( 0 , STATE_OFF )
return the brightness and state .